Jump to content

Add drop down attribute menu on frontpage/ Featured products


Recommended Posts

Hey Chaps,

Well, thanks for a good few member on this forum, we are so super close to clompleing our actuall front office design and very happy with what has been done.

There are only a few small issues remaining really and he is one of them:

On the frobnt page, where the fearuted products are located, when a customer clicks "add to cart" and if this particular products happens to have a size attribute i.e. medium, large or extra large, the customer automatically seems to add the medium choice by default to the cart. Is there anyway to add that particular drop down menu to the front page as indicated in my attached screenshot:

As always any help would be appreciated to know which files to change.

17492_zsDoyqr2iMyozbtq7Wdb_t

Link to comment
Share on other sites

This is actually very difficult to do. Prestashop uses Javascript to display the attribute prices on the product page and puts every possible combination into the HTML code. To get the attributes to work on the product listings, you'd have to find a way to put every combination of attributes for every product on the one page and modify the Javascript so that they work together and don't conflict. Even if you manage to do it, I think it would slow down the loading of the product listings dramatically. It would be a lot of work and I doubt anyone will post a solution for free here. Maybe you could pay someone to do it.

Link to comment
Share on other sites

I completely agree with what you said. If it will compremise speeds then it's not worth it. Is there maybe a way to make the Add to cart just lick to the actuall product instead of add to cart on the front page? Basically the front page add to cart button uses the view link?

Link to comment
Share on other sites

It is the following section starting on line 20 of modules/homefeatured/homefeatured.tpl that you should modify:

{if ($product.quantity > 0 OR $product.allow_oosp) AND $product.customizable != 2}
{l s='Add to cart' mod='homefeatured'}
{else}
{l s='Add to cart' mod='homefeatured'}
{/if}



You could {* comment out *} this code to remove the "Add to cart" button altogether, or change its link to {$product.link} so that it acts like the "View" button. You could also disable the "Add to cart" button when the product has attributes by changing the first line to:

{if ($product.quantity > 0 OR $product.allow_oosp) AND $product.customizable != 2 AND $product.id_product_attribute == 0}

Link to comment
Share on other sites

Would it be possible then to change the text on the "view" button to rather say "View / Sizes" ?
Do this in Translations?

Because some clients might first click "Add to cart" without realising that there are in fact size /colour attributes that should be first chosen otherwise the default attribute is selected...

Link to comment
Share on other sites

Ok, translating works but I thought about what you said a few posts back

"It is the following section starting on line 20 of modules/homefeatured/homefeatured.tpl that you should modify:

{if ($product.quantity > 0 OR $product.allow_oosp) AND $product.customizable != 2}
{l s='Add to cart' mod='homefeatured'}
{else}
{l s='Add to cart' mod='homefeatured'}
{/if}

You could {* comment out *} this code to remove the “Add to cart” button altogether, or change its link to {$product.link} so that it acts like the “View” button. You could also disable the “Add to cart” button when the product has attributes by changing the first line to:

{if ($product.quantity > 0 OR $product.allow_oosp) AND $product.customizable != 2 AND $product.id_pro"


Could you please assist me to do the same to the product list?

Regards,

Link to comment
Share on other sites

  • 7 months later...

It is the following section starting on line 20 of modules/homefeatured/homefeatured.tpl that you should modify:


{if ($product.quantity > 0 OR $product.allow_oosp) AND $product.customizable != 2} {l s='Add to cart' mod='homefeatured'}{else} {l s='Add to cart' mod='homefeatured'}{/if}
You could {* comment out *} this code to remove the “Add to cart” button altogether, or change its link to {$product.link} so that it acts like the “View” button. You could also disable the “Add to cart” button when the product has attributes by changing the first line to:


{if ($product.quantity > 0 OR $product.allow_oosp) AND $product.customizable != 2 AND $product.id_product_attribute == 0}



Is it possible to keep only the view button visible in case of existing attribute/combinations? Because with the above code I believe it still shows 'add to cart' but impossible to click on.
This can be confiusing for customers because they might think the product cannot be ordered.
Link to comment
Share on other sites

That didn't work I guess there is something different in my code.
This is my code after I did the first modification:

    {if ($product.quantity > 0 OR $product.allow_oosp) AND $product.customizable != 2 AND $product.id_product_attribute == 0} 
{l s='Add to cart'}
               {else}
{l s='Add to cart'}
               {/if}



Maybe you can see the problem?
PS I work with a third party theme.

Link to comment
Share on other sites

Great Rocky, that did the job!!

Yesterday I met another problem, not sure if I should open a new topic or if I can ask it over here?

After using the attributes generator, and willing to modify the default combination; I get an error on top of the page saying:

1 error   1. This attribute already exists.

Link to comment
Share on other sites

  • 5 months later...
  • 1 month later...

Rocky

I tried your solution to remove the Add to cart option when the product had attributes but I just wont work, the add button is still there. Here's my code of product-list.tpl

{if ($product.quantity > 0 OR $product.allow_oosp) AND $product.customizable != 2 AND $product.id_product_attribute == 0}                     {l s='Add to cart'}                
<!--{else}                        {l s='Add to cart'}-->
               {/if}

Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...

And what about the possibility of amke a menu on the home page with possibility of choosing by size for example. Bec i put attributes but from hundreds of clothes and items how can they choose sizez available for deffinete models the need.

 

Is it possible to make a section in main menu with attributes in my case children sizes (from 0 to 12) a simple or any other answer pls

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...