Thread: A few questions

Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 45
  1. #21
    Join Date
    Aug 2006
    Posts
    35
    Plugin Contributions
    0

    Default Re: A few questions

    Ok I understood that so far, but can you explain it a little more, if I am not careful, see with me, I always build stuff from scratch, this is my first time working on a third party system, but my experience is allowing me to, once I find the files, I know of 10-20 ways I would normally do this on my own system, but I don't know the large system, and I know on a system like this, 1 misprint code, could mess up a large portion of the functionality, I want to be very careful, as for the styling thing, I already got that situated.

  2. #22
    Join Date
    Aug 2006
    Posts
    35
    Plugin Contributions
    0

    Default Re: A few questions

    Ok, now that I stood back and see what I need, I need help doing 2 things.
    1. Getting a link to appear, based on what attribute is there.

    2. Getting to the point, ok we create an attribute, it has a text field, we created this of course using the admin, we need to be able get it to where, the idea is a link appears next to the page. Ok, next to that attribute I mean, then they click the link it takes them to the color pallete. They pick a color, then on the actually color pallete, it has a link going back to the previous page, with a get query that have the information on the color they chose. After they chose the color and click the url, it takes them back to the page they came from, and is suppose to populate that text field, that will allow it to carry the number over into the shoping cart without us having to do anything manually.

  3. #23
    Join Date
    Aug 2006
    Posts
    35
    Plugin Contributions
    0

    Default Re: A few questions

    1. you can create an extra field in your product attributes table, and then output that alongside the $options_menu[]
    Can you explain a little more on what you mean by that actually, I think that will solve my problem on the links once I understand that completely. As for getting the link to populate that field, I can tackle that once I get the theory down on getting links to appear based on attribute.

  4. #24
    Join Date
    Aug 2006
    Posts
    35
    Plugin Contributions
    0

    Default Re: A few questions

    That sounds logical, but this is what I need.
    We have a field called chooselaminate or something, it has a text field, we need to have that, wherever it shows that attribute, it shows a link, above or below it.
    Then I can populate the text field, with the results when the link comes back. Now as far as it goes with the others, he might have an other text box called something else, but he needs another"different" link to appear where all of those go, he might have like 4-5 different attributes, and each attribute type is going to need a different url to appear with it wherever that attribute it.

  5. #25
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: A few questions

    The attributes module I mentioned -- that's where you'll have to build this. Lotsa fun.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #26
    Join Date
    Aug 2006
    Posts
    35
    Plugin Contributions
    0

    Default Re: A few questions

    building it is fine, I just have to understand the concept. You mentioned something about creating a table, and outputing it beside teh field, on that page, can you give me a little background on that process if you have used it before, as far as populating the text field with the get return from that url, do you know where I can find the text field to set that up.

  7. #27
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: A few questions

    i don't recall mentioning any table.

    But as for text fields, the attribute text fields are built dynamically, and are numbered according to sort orders specified when creating them in the admin area.
    So, to find out the name or id of the text field in order to have a javascript tool update said field, open the product page in your browser, use View Source to see all the field names associated with the desired attribute, and use that information to build your linkage.

    Attribute information is not passed via GET ... it uses POST, so you will have to get creative in order to pass the updates. Hence the mention of javascript ... which would only be useful if your laminates page was a popup...
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #28
    Join Date
    Aug 2006
    Posts
    35
    Plugin Contributions
    0

    Default Re: A few questions

    Ok, I had some usage with the id's when I was setting the styles. But I am a little confused, I have 2 files, the tpl_module_attributes.php and attributes.php
    the tpl_module_attributes.php I know displays all the information, the attributes.php is the page that prepares all the information to display. What you said sounded logical, to get javascript to open a window, and everything, but I think I am still missing something. Can you explain to me one more time, about getting a link to appear based on what attribute is there. I am still a little confused. I guess more of on the system, I know my way around quite a bit, and I learn very fast, very fast, that is why I am getting on so quickly, but I am a little hazy on this part still. As far as populating the text field, so there is no way to get direct access to the input tag that contains that text field? A little more clarification on a few more things and I think I will be good to go.

  9. #29
    Join Date
    Aug 2006
    Posts
    35
    Plugin Contributions
    0

    Default Re: A few questions

    Code:
    1. you can create an extra field in your product attributes table, and then output that alongside the $options_menu[]
    
    2. put a switch statement alongside the $options_menu[] echo statement.
    That is where table was mentioned, it was posted by someone else shortly after you posted that one.

  10. #30
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: A few questions

    A little visit in to the code in attributes.php shows this, starting on line 383.
    The logic loops through a few possible attribute settings as defined in the admin interface in order to determine how to display the text field, and then builds the <INPUT...> tag for it, using zen_draw_input_field().

    If you want to detect a specific attribute, simply catch it in the loop and do whatever extra you desire to the output string.

    Code:
                      // text
                      if (($products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_TEXT)) {
                        //CLR 030714 Add logic for text option
                        //            $products_attribs_query = zen_db_query("select distinct patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$_GET['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'");
                        //            $products_attribs_array = zen_db_fetch_array($products_attribs_query);
                        if ($_POST['id']) {
                          reset($_POST['id']);
                          foreach ($_POST['id'] as $key => $value) {
                            //echo ereg_replace('txt_', '', $key) . '#';
                            //print_r($_POST['id']);
                            //echo $products_options_names->fields['products_options_id'].'|';
                            //echo $value.'|';
                            //echo $products_options->fields['products_options_values_id'].'#';
                            if ((ereg_replace('txt_', '', $key) == $products_options_names->fields['products_options_id'])) {
                              // use text area or input box based on setting of products_options_rows in the products_options table
                              if ( $products_options_names->fields['products_options_rows'] > 1) {
                                $tmp_html = '  <input disabled="disabled" type="text" name="remaining' . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . '" size="3" maxlength="3" value="' . $products_options_names->fields['products_options_length'] . '" /> ' . TEXT_MAXIMUM_CHARACTERS_ALLOWED . '<br />';
                                $tmp_html .= '<textarea class="attribsTextarea" name="id[' . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . ']" rows="' . $products_options_names->fields['products_options_rows'] . '" cols="' . $products_options_names->fields['products_options_size'] . '" onKeyDown="characterCount(this.form[\'' . 'id[' . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . ']\'],this.form.' . TEXT_REMAINING . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . ',' . $products_options_names->fields['products_options_length'] . ');" onKeyUp="characterCount(this.form[\'' . 'id[' . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . ']\'],this.form.' . TEXT_REMAINING . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . ',' . $products_options_names->fields['products_options_length'] . ');" id="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '" >' . stripslashes($value) .'</textarea>' . "\n";
                              } else {
                                $tmp_html = '<input type="text" name="id[' . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . ']" size="' . $products_options_names->fields['products_options_size'] .'" maxlength="' . $products_options_names->fields['products_options_length'] . '" value="' . stripslashes($value) .'" id="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '" />  ';
                              }
                              $tmp_html .= $products_options_details;
                              break;
                            }
                          }
                        } else {
                          $tmp_value = $_SESSION['cart']->contents[$_GET['products_id']]['attributes_values'][$products_options_names->fields['products_options_id']];
                          // use text area or input box based on setting of products_options_rows in the products_options table
                          if ( $products_options_names->fields['products_options_rows'] > 1 ) {
                            $tmp_html = '  <input disabled="disabled" type="text" name="remaining' . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . '" size="3" maxlength="3" value="' . $products_options_names->fields['products_options_length'] . '" /> ' . TEXT_MAXIMUM_CHARACTERS_ALLOWED . '<br />';
                            $tmp_html .= '<textarea class="attribsTextarea" name="id[' . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . ']" rows="' . $products_options_names->fields['products_options_rows'] . '" cols="' . $products_options_names->fields['products_options_size'] . '" onkeydown="characterCount(this.form[\'' . 'id[' . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . ']\'],this.form.' . TEXT_REMAINING . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . ',' . $products_options_names->fields['products_options_length'] . ');" onkeyup="characterCount(this.form[\'' . 'id[' . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . ']\'],this.form.' . TEXT_REMAINING . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . ',' . $products_options_names->fields['products_options_length'] . ');" id="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '" >' . stripslashes($tmp_value) .'</textarea>' . "\n";
                            //                $tmp_html .= '  <input type="reset">';
                          } else {
                            $tmp_html = '<input type="text" name="id[' . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . ']" size="' . $products_options_names->fields['products_options_size'] .'" maxlength="' . $products_options_names->fields['products_options_length'] . '" value="' . htmlspecialchars($tmp_value) .'" id="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '" />  ';
                          }
                          $tmp_html .= $products_options_details;
                          $tmp_word_cnt_string = '';
                          // calculate word charges
                          $tmp_word_cnt =0;
                          $tmp_word_cnt_string = $_SESSION['cart']->contents[$_GET['products_id']]['attributes_values'][$products_options_names->fields['products_options_id']];
                          $tmp_word_cnt = zen_get_word_count($tmp_word_cnt_string, $products_options->fields['attributes_price_words_free']);
                          $tmp_word_price = zen_get_word_count_price($tmp_word_cnt_string, $products_options->fields['attributes_price_words_free'], $products_options->fields['attributes_price_words']);
    
                          if ($products_options->fields['attributes_price_words'] != 0) {
                            $tmp_html .= TEXT_PER_WORD . $currencies->display_price($products_options->fields['attributes_price_words'], zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . ($products_options->fields['attributes_price_words_free'] !=0 ? TEXT_WORDS_FREE . $products_options->fields['attributes_price_words_free'] : '');
                          }
                          if ($tmp_word_cnt != 0 and $tmp_word_price != 0) {
                            $tmp_word_price = $currencies->display_price($tmp_word_price, zen_get_tax_rate($product_info->fields['products_tax_class_id']));
                            $tmp_html = $tmp_html . '<br />' . TEXT_CHARGES_WORD . ' ' . $tmp_word_cnt . ' = ' . $tmp_word_price;
                          }
                          // calculate letter charges
                          $tmp_letters_cnt =0;
                          $tmp_letters_cnt_string = $_SESSION['cart']->contents[$_GET['products_id']]['attributes_values'][$products_options_names->fields['products_options_id']];
                          $tmp_letters_cnt = zen_get_letters_count($tmp_letters_cnt_string, $products_options->fields['attributes_price_letters_free']);
                          $tmp_letters_price = zen_get_letters_count_price($tmp_letters_cnt_string, $products_options->fields['attributes_price_letters_free'], $products_options->fields['attributes_price_letters']);
    
                          if ($products_options->fields['attributes_price_letters'] != 0) {
                            $tmp_html .= TEXT_PER_LETTER . $currencies->display_price($products_options->fields['attributes_price_letters'], zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . ($products_options->fields['attributes_price_letters_free'] !=0 ? TEXT_LETTERS_FREE . $products_options->fields['attributes_price_letters_free'] : '');
                          }
                          if ($tmp_letters_cnt != 0 and $tmp_letters_price != 0) {
                            $tmp_letters_price = $currencies->display_price($tmp_letters_price, zen_get_tax_rate($product_info->fields['products_tax_class_id']));
                            $tmp_html = $tmp_html . '<br />' . TEXT_CHARGES_LETTERS . ' ' . $tmp_letters_cnt . ' = ' . $tmp_letters_price;
                          }
                          $tmp_html .= "\n";
                        }
                      }
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 
Page 3 of 5 FirstFirst 12345 LastLast

Similar Threads

  1. A few questions...
    By bendparker in forum Templates, Stylesheets, Page Layout
    Replies: 18
    Last Post: 21 Oct 2008, 06:17 PM
  2. A few questions
    By vito in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 11 Aug 2008, 02:00 AM
  3. Few Questions on a few issues.
    By RSprinkel in forum General Questions
    Replies: 6
    Last Post: 10 Mar 2007, 12:02 PM
  4. Few Questions
    By maxpower1998 in forum General Questions
    Replies: 0
    Last Post: 13 Nov 2006, 10:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg