Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Attributes not rendering on page

Attributes not rendering on page

Views: 1,270

Results 1 to 10 of 10
24 Feb 2014, 11:09 PM
#1
djdavedawson avatar

djdavedawson

Zen Follower

Join Date:
Jul 2005
Location:
Orlando, Fl
Posts:
343
Plugin Contributions:
0

Attributes not rendering on page

Every once and a while I get an order for an item without it's attributes specified.

I cannot recreate the issue but from what i've been told by the customers, the attributes weren't there when they ordered.

It's happening on different browsers and products.

This issue just started happening within the last few weeks and never had before that for years.

Any ideas on what may be causing this?

Thanks in Advance.

~D

24 Feb 2014, 11:26 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Attributes not rendering on page

Have you any information on the product such as the URL that is used that we could peek at?

24 Feb 2014, 11:30 PM
#3
djdavedawson avatar

djdavedawson

Zen Follower

Join Date:
Jul 2005
Location:
Orlando, Fl
Posts:
343
Plugin Contributions:
0

Re: Attributes not rendering on page

Thanks Ajeh, I PMd you the link to the last item this happened to.

24 Feb 2014, 11:34 PM
#4
djdavedawson avatar

djdavedawson

Zen Follower

Join Date:
Jul 2005
Location:
Orlando, Fl
Posts:
343
Plugin Contributions:
0

Re: Attributes not rendering on page

Ajeh,

I actually just figured out how it happened. I have a compare module that allows you to add the item to cart from the compare screen. This is how it's happening.

24 Feb 2014, 11:37 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Attributes not rendering on page

I was about to tell you ... your compare program is allow this to happen ... :blink:

24 Feb 2014, 11:41 PM
#6
djdavedawson avatar

djdavedawson

Zen Follower

Join Date:
Jul 2005
Location:
Orlando, Fl
Posts:
343
Plugin Contributions:
0

Re: Attributes not rendering on page

Thanks for your time.

24 Feb 2014, 11:58 PM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Attributes not rendering on page

Sure thing ... glad you have found the cause and posted the issue ... :smile:

25 Feb 2014, 5:39 PM
#8
djdavedawson avatar

djdavedawson

Zen Follower

Join Date:
Jul 2005
Location:
Orlando, Fl
Posts:
343
Plugin Contributions:
0

Re: Attributes not rendering on page

I'm using the function zen_has_product_attributes to determine which products can be added to cart or sent back to the product page. Is there something native I can use to determine if those attributes are required ?

Thanks

25 Feb 2014, 6:29 PM
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Attributes not rendering on page

In the module for the Product Listing ... look at this section of code to see what all should be checked to determine Add to Cart vs buttons etc:

        case 'PRODUCT_LIST_PRICE':
        $lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />';
        $lc_align = 'right';
        $lc_text =  $lc_price;

        // more info in place of buy now
        $lc_button = '';
        if (zen_has_product_attributes($listing->fields['products_id']) or PRODUCT_LIST_PRICE_BUY_NOW == '0') {
          $lc_button = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? $_GET['cPath'] : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
        } else {
          if (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0) {
            if (
                // not a hide qty box product
                $listing->fields['products_qty_box_status'] != 0 &&
                // product type can be added to cart
                zen_get_products_allow_add_to_cart($listing->fields['products_id']) != 'N'
                &&
                // product is not call for price
                $listing->fields['product_is_call'] == 0
                &&
                // product is in stock or customers may add it to cart anyway
                ($listing->fields['products_quantity'] > 0 || SHOW_PRODUCTS_SOLD_OUT_IMAGE == 0) ) {
              $how_many++;
            }
            // hide quantity box
            if ($listing->fields['products_qty_box_status'] == 0) {
              $lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action', 'products_id')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
            } else {
              $lc_button = TEXT_PRODUCT_LISTING_MULTIPLE_ADD_TO_CART . "<input type=\"text\" name=\"products_id[" . $listing->fields['products_id'] . "]\" value=\"0\" size=\"4\" />";
            }
          } else {
// qty box with add to cart button
            if (PRODUCT_LIST_PRICE_BUY_NOW == '2' && $listing->fields['products_qty_box_status'] != 0) {
              $lc_button= zen_draw_form('cart_quantity', zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action', 'products_id')) . 'action=add_product&products_id=' . $listing->fields['products_id']), 'post', 'enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($listing->fields['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_draw_hidden_field('products_id', $listing->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</form>';
            } else {
              $lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action', 'products_id')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
            }
          }
        }
        $the_button = $lc_button;
        $products_link = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . ( ($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : $_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id'])) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
        $lc_text .= '<br />' . zen_get_buy_now_button($listing->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($listing->fields['products_id']);
        $lc_text .= '<br />' . (zen_get_show_product_switch($listing->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? (zen_get_product_is_always_free_shipping($listing->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '') : '');

        break;
25 Feb 2014, 7:01 PM
#10
djdavedawson avatar

djdavedawson

Zen Follower

Join Date:
Jul 2005
Location:
Orlando, Fl
Posts:
343
Plugin Contributions:
0

Re: Attributes not rendering on page

This code switches the functionality based on the existence of the 'products_attributes_id'

I was hoping there was something native that would also check the 'attributes_required' db column.

I was thinking about bypassing attribute selection for items that didn't require specific attributes for product configuration when added to cart from the compare page.

ie. Attributes that are more like add-ons would be bypassed.

After thinking about it, I decided not to go that route.

Thanks again!