Forums / Templates, Stylesheets, Page Layout / Attributes and Add to Cart/more info

Attributes and Add to Cart/more info

Locked

Views: 1,154

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
7 Sep 2006, 11:04 PM
#1
hrm avatar

hrm

New Zenner

Join Date:
Oct 2005
Posts:
95
Plugin Contributions:
0

Attributes and Add to Cart/more info

I could really use some help with the product listing layout (new products and all products, as well).

I have Multiple Products Qty Box on, but any product with attributes (all of mine have at least one, all will eventually have 2). I would like for the "more info" to show only if a product has more than one attribute.

Can anyone help?

I'm guessing that the following code needs to be adjusted, but I could be wrong (I'm not great with PHP):

// 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']), 'products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';

            } else {

              if (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0) {

                $how_many++;

                $lc_button = TEXT_PRODUCT_LISTING_MULTIPLE_ADD_TO_CART . "<input type=\"text\" name=\"products_id[" . $listing->fields['products_id'] . "]\" value=0 size=\"4\">";

              } else {

                $lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT) . '</a> ';

              }

            }

            $the_button = $lc_button;

            $products_link = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_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']);

Heather
Results! Why, man, I have gotten a lot of results.
I know several thousand things that won't work.
----Thomas Edison

7 Sep 2006, 11:32 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Attributes and Add to Cart/more info

I would like for the "more info" to show only if a product has more than one attribute.But ... the reason the "more info" link shows ... is that the add-to-cart process requires that the attribute be drawn on-screen in order for it to be selected and included in the add-to-cart process.

.
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 Sep 2006, 12:28 AM
#3
hrm avatar

hrm

New Zenner

Join Date:
Oct 2005
Posts:
95
Plugin Contributions:
0

Re: Attributes and Add to Cart/more info

Would it be possible to show both attributes on the listing page and maybe an "add to cart" button for each attribute?

Here's a url if you'd like to take a look at what I've got
http://www.omegasound.com/index.php?main_page=index&cPath=6

The $8.00 products have 2 attributes and the $8.99 products have only 1.

It would be wonderful if I could have something like "more info" where the description would be in the listing. Is that do-able?

I'm using 1.2.6d by the way. (getting ready to start test the upgrade to 1.3.5)

Heather
Results! Why, man, I have gotten a lot of results.
I know several thousand things that won't work.
----Thomas Edison

8 Sep 2006, 3:03 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Attributes and Add to Cart/more info

I think someone has tackled something like that somewhere here on the forum. I doubt it's for v1.2.x though.

There's a reason why it's not an available option yet ... the complexities and dependencies and need to check for uniqueness and to handle every possible attribute combination for each of possibly hundreds of products on one listing page ... is a huge undertaking, not to mention bug-prone, as well as likely to slow the product-listing page to a crawl if many products have many attributes on them.

Sorry, but something like this is on the wishlist, but isn't scheduled anytime soon. As such, you may want to post a Commercial Help Wanted ad and hire someone to do it for you. It would be great if you were to also share it back with the community once completed, but that's optional and of course entirely up to you.

.
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.