Skip to main content

Remove Add to Cart button on product listing

More
14 years 2 months ago #57985 by chadders
I expect that I am missing something obvious, but I'd be grateful for help. I've set the "Display Add to Cart button" to no in the default parameters for products, but the button still shows.
I've search and searched but can't find what I've missed. Anyone help?
Thanks

Please Log in or Create an account to join the conversation.

More
14 years 2 months ago #58026 by nicolas
Hi,

That's a default parameter. So it works only for new menus and modules.
For existing menus and modules, you will find similar options via the menus Display->Content menus/modules.
You can also just create a new menu and it will use that value.

Please Log in or Create an account to join the conversation.

More
14 years 2 months ago #58794 by chadders
Thanks for this help. I'm please I asked before we got much further, having created dozens of product listings already!

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago #59270 by coruja
Hello Nicolas.

I am using just the starter version. I am also looking for a solution to this without having to delete existing modules or hacking the PHP code.

The method you mention: "For existing menus and modules, you will find similar options via the menus Display->Content menus/modules."

This does not seem to be correct, I do not see the option to Display/not display the "Add to cart" button in the Display > Content menus.

Can you confirm?

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago #59300 by nicolas
I can confirm that this method is correct.
Once you are in the menu Display > Content menus, you need to edit your products listing menu and you will see the option among all the other options of your products listing menu.

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago #59355 by coruja

nicolas wrote: I can confirm that this method is correct.
Once you are in the menu Display > Content menus, you need to edit your products listing menu and you will see the option among all the other options of your products listing menu.


As always Nicolas you are correct, thank you.

This may not be the place to raise this suggestion:
I find all the answers to any question I have on this forum - which is very nice, but I would prefer a lot of these things to be documented properly.

And, I find the main documentation for Hika Shop a bit lacking - sometimes parts are missing altogether and sometimes the language is very confusing.

Since a lot of people are using this extension in its free version, would you consider opening up your documentation (as a Wiki for example) so that the community that are using can at least contribute something, prepare FAQ for things such as the one here and keep the main documentation updated?

Regards,

Please Log in or Create an account to join the conversation.

More
14 years 1 month ago #59416 by nicolas
You are more than welcome to write tutorials and such for HikaShop.
We would be even more happy to include them in our documentation if you are ok with that.
If you do so, just send a contact request to us via our contact form:
www.hikashop.com/en/contact-us.html

Also, if you have specific things you would like to add in one place or another in the FAQ, do not hesitate to tell us. We will be more than happy to improve the documentation.

A wiki wouldn't allow us to include the documentation inside HikaShop views like we do at the moment, so I don't see that happening in the short term though.

Please Log in or Create an account to join the conversation.

More
13 years 1 week ago #123647 by billkarv
Hi, I need some help please.
I 've found the content menu, but I am trying to remove the add to cart buttons only in one subcategory.
How can I override the existing options of my main category?

Please Log in or Create an account to join the conversation.

More
13 years 1 week ago #123743 by Xavier
Hi,

You have to override the view "product / listing" and in the foreach on the categories "foreach($this->categories as $category) {" add a code like:
Code:
$oldAddToCartParameter = $this->params->get('add_to_cart'); if($category['category']->category_id == your_category_id){ $this->params->set('add_to_cart', 0); }else{ $this->params->set('add_to_cart',$oldAddToCartParameter); }

Please Log in or Create an account to join the conversation.

More
13 years 1 week ago #123777 by billkarv
Thank you for the reply, but this code I think will be change all my products, and I want to remove the button only in one category!

Please Log in or Create an account to join the conversation.

More
13 years 1 week ago #123841 by Xavier
Yes, that's why there is a check on the category id, you have to replace "your_category_id" by the category where you want to hide the add to cart button.

So all the products of this category will not have the "add to cart" button displayed.

Please Log in or Create an account to join the conversation.

More
13 years 1 week ago - 13 years 1 week ago #123845 by billkarv
This is my product / listing file, but I don't find where to put the code, can you help me?:

Full source code of the view removed. Don't worry, we have it too :)

Last edit: 13 years 1 week ago by Jerome.

Please Log in or Create an account to join the conversation.

More
13 years 1 week ago #123871 by Jerome
Hi,

Replace:
Code:
foreach($this->categories as $category) { if(empty($category['products'])) continue;
By
Code:
$oldAddToCartParameter = $this->params->get('add_to_cart'); foreach($this->categories as $category) { if(empty($category['products'])) continue; if($category['category']->category_id == 0 /* Put your category id instead of 0 */ ){ $this->params->set('add_to_cart', 0); }else{ $this->params->set('add_to_cart',$oldAddToCartParameter); }
Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

More
13 years 1 week ago #124044 by billkarv
I'm sorry but the part:
Code:
foreach($this->categories as $category) { if(empty($category['products'])) continue;

Does not exist in my view file. Is it another version? My hikashop business version is 2.2.1.

Please Log in or Create an account to join the conversation.

More
13 years 1 week ago #124086 by Xavier
Hi,

It's near the line 221. If you don't have it, that's maybe because you have an override on this view.
Thanks to save your current override in an external file, then remove the override by clicking on the dustbin on the views listing.

Please Log in or Create an account to join the conversation.

More
13 years 1 week ago #124224 by billkarv
As you can see in the picture there is no override and the line of the code not exist!

Please Log in or Create an account to join the conversation.

More
13 years 1 week ago #124262 by Xavier
Thanks to try to download the latest version of HikaShop from our website and install it over your current version, you should have the code after this update.

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago - 12 years 10 months ago #133000 by webarts
hi ,

how i can remove the add to cart from the product listing here

server.webartscy.com/~mazrin/index.php/h...egory/13-decorations

i set the the value to No at the product listing option but nothing change

also i want to hide the product code from the product listing .
Last edit: 12 years 10 months ago by webarts.

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #133069 by nicolas
Hi,

I don't see the add to cart button on that listing.
Regarding the product code, you would need to add such CSS:
.hikashop_product_code_list{ display: none; }

How to add CSS:
www.hikashop.com/support/documentation/1...ize-the-display.html

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #133279 by webarts
sorry Nicolas i was facing problems with the template,

here is the url

server.webartscy.com/~mazrin/index.php/h...ategory/14-ornaments

i set on the content menu product listing the option "Display 'Add to cart' button" to NO .

Please Log in or Create an account to join the conversation.

Time to create page: 0.331 seconds
Powered by Kunena Forum