Jump to content

"add to cart" disabled for products with attributes not working for "new products"


Recommended Posts

hi, I am facing strange issue with my presta 1.5.3. (but the same problem appeared on my 1.5.2.) I am trying to disable "add to cart" option for all products with attributes - so the customer has first to choose product attribute and add to cart after that. I switched that option off in Preferences -> Products but it does not work for any product that is marked as "New". For rest of products "add to cart" option is disabled as it should, only "new products" are not affected.

 

Attached is a screenshot showing the issue.

 

Can anyone help on that one?

 

Also , when adding new product I am getting this on top of the screen :

 

Warning: Wrong parameter count for clearstatcache() in /home/...../public_html/classes/ImageManager.php on line 122

 

 

I didn't find any option that this would affect, but it could be somehow connected with main issue.

post-436005-0-87822700-1357978627_thumb.jpg

Edited by mag80 (see edit history)
Link to comment
Share on other sites

I have the same problem. I'm not sure if it is theme related, (coding in the tpl). I do know that products display fine on my homepage, (just view button, no "add to cart"), but on category pages the page may or may not show the "add to cart".

 

So I disabled the add to cart using a work around hack. It will do until I find a better solution.

 

What I did was change one line in my theme product-list.tpl

 

 

Around line 35

 

{if ($product.id_product_attribute == 0 ||

 

Change 0 to 1

 

{if ($product.id_product_attribute == 1 ||

Edited by Bill Dalton (see edit history)
Link to comment
Share on other sites

it's strange. I had this issue with presta 1.5.2. Because of other errors, instead of updating I decided to install fresh copy of 1.5.3 and adopt it again to my needs. Exactly the same error is occurring in my fresh install. Now I'm sure it's not related to only to "new" products as currently some products marked as "new" got "add to cart" option visible and some others don't. As Bill Dalton mentioned the problem occurs only in category view.

 

I got no clue why fresh copy got same big error.

Link to comment
Share on other sites

got it! I just checked few options and found out that when you add new product, this option is not working correctly. "add to cart" "on" and "off" option works only for products that were already bought in store. For instance:

 

1 add new product and check if this option is working

2. if not , login as customer in your store and buy 1pc of this product

3. check the store again and you'll see is working fine now

 

I now it's not a long term solution but can do for now. Hope that someone with more experience can put some more light on that issue.

Edited by mag80 (see edit history)
Link to comment
Share on other sites

  • 4 months later...
  • 6 months later...

I don't know if this will help you, but I am posting my solution everywhere on these forums where I see people pulling their hair out for such a simple solution to a massive problem...

 

I MUST have my customers choosing product attributes before they click the "ADD TO CART" button.

Yes I know you can set in admin to hide the "ADD TO CART" button if there are product attributes, but when viewing product lists, non-attributed products will have an "ADD TO CART" button and attributed products will have nothing at all.

 

This is confusing as hell to clients and looks horribly messy. They will not know to click the product image to take them to the product screen, and will leave the store.

 

So what I did was - when viewing product lists, I swopped the "ADD TO CART" button for the "VIEW" button. The text and functionality work.

 

Running PS 1.5.6 I edited "product-list.tpl" on lines 49-52

 

Like so:

                                                          <a class="button exclusive view_button" href="{$product.link|escape:'htmlall':'UTF-8'}" title="{l s='View'}"><i class="icon-eye-2 icon-1x icon-mar-lr2"></i><span>{l s='View'}</span></a>
        						{*<a class="button ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add=1&id_product={$product.id_product|intval}&token={$static_token}", false)|escape:'html'}" title="{l s='Add to Cart'}"><i class="icon-basket icon-1x icon-mar-lr2"></i><span>{l s='Add to Cart'}</span></a>*}
        					{else}
        						{*//<a class="button ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add=1&id_product={$product.id_product|intval}", false)|escape:'html'}" title="{l s='Add to Cart'}"><i class="icon-basket icon-1x icon-mar-lr2"></i><span>{l s='Add to Cart'}</span></a>*}
  • Like 1
Link to comment
Share on other sites

  • 4 months later...

if it helps anyone, I found the problem is that if you don't assign a default combination to a product, then any settings you change in the back office will be ignored.  so, in order to fix this go to Products > (chose your product) Combinations > edit > then check the boxes to make a particular item the default product and save. Check your front office for confirmation.

Link to comment
Share on other sites

×
×
  • Create New...