[Skip to main content](#vessel-content)

#   Display variant options on product listing

##

- **[jaime815](/forum/user/1555-jaime815 "View jaime815's Profile")**
- [![jaime815's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/1555-jaime815 "View jaime815's Profile") Topic Author
- [ Offline](/forum/user/1555-jaime815)

Less More

- Posts: 7
- Thank you received: 0
-
-

15 years 7 months ago [\#10827](#10827) by [jaime815](/forum/user/1555-jaime815 "View jaime815's Profile")  *[Display variant options on product listing](/forum/4-how-to/10827-display-variant-options-on-product-listing#10827 "Hi there,  I've been searching for an answer to my question on the forum, and haven't quite found a solution yet. However, I do apologize if this question is redundant in any way, and if I have missed any documentation or help.  Also, if it's necessary to help, I'm using the &quot;Essentials&quot; version.  Basically what I'm trying to do is cut out the product page from the entire purchasing process. I'm using {loadposition} to load only one product in each article, and each product will require variants. As of now, in the article, it displays the &quot;Show Options&quot; button which then takes them to the product page, which then displays the &quot;Add to Cart&quot; button. My products are so simple in nature, that the product page does not show the customer any new information, except the ability to choose their option/variant. To save the customer time, and to reduce this process, I'm hopeful that I can get the variants to display on the product listing, and that the button would no longer say &quot;Show Options,&quot; but would say &quot;Add to Cart&quot; and take them directly to the cart, much like products that don't have variants.  I read another post here on the forum, where you gave this response:  This makes sense to me, especially if you are loading many products on one page, but like I mentioned, I will only ever have one product on one page. And I understand based on your response above, that what I'm asking for seems to go against the grain of HikaShop, but I'm extremely hopeful you can help me achieve a solution.  A couple of theories I have are below, but honestly, I'm no PHP expert so I don't know if this is even possible.  1) Display the product page in the {loadposition} rather than the product listing. (Because both the product listing and product page have the exact same info except the variants &amp; quantity, it makes sense logically to me, to remove the product listing from the entire process, instead of the product page).  2) Rework what the module displays. For instance, there are options in the module to display Random Items, 'Add to Cart' button, Link to product page, and Display price. Could we have an option to display variants? If this is possible, could we change the &quot;Show Options&quot; button to &quot;Add to Cart&quot; and direct to the cart, rather than the product page? I understand this would take quite a bit of code rework, and my guess for a place to start would be to change/add these things:  &#42; Add something like this to the modules/zzparams.php view, perhaps?  &#42; Add something like this to the product listing view:  &#42; Somehow change the &quot;Show Options&quot; text and destination?? Not sure where to do this.  Obviously, these are my wild guesses, but I honestly have no idea where to start and how much I'm asking really requires. If possible, could you detail what code needs to be added or changed to make this possible? I'd really appreciate it!  Thanks for all of your hard work -- your product is amazing!")* was created by *[jaime815](/forum/user/1555-jaime815 "View jaime815's Profile")*

Hi there,

I've been searching for an answer to my question on the forum, and haven't quite found a solution yet. However, I do apologize if this question is redundant in any way, and if I have missed any documentation or help.

Also, if it's necessary to help, I'm using the "Essentials" version.

Basically what I'm trying to do is cut out the product page from the entire purchasing process. I'm using {loadposition} to load only one product in each article, and each product will require variants. As of now, in the article, it displays the "Show Options" button which then takes them to the product page, which then displays the "Add to Cart" button. My products are so simple in nature, that the product page does not show the customer any new information, except the ability to choose their option/variant. To save the customer time, and to reduce this process, I'm hopeful that I can get the variants to display on the product listing, and that the button would no longer say "Show Options," but would say "Add to Cart" and take them directly to the cart, much like products that don't have variants.

I read another post here on the forum, where you gave this response:

> Variants options aren't displayed on the listing of products so if you have products with variants you should indeed have the user go in the product page so that he can select the variant before adding to the cart.
>
> I understand what you want to do but we wanted to avoid loading all the variants data with all the processing behind for each product of the listing because if you start having a lot of products displayed and a lot of variants for each, it's just too much. So we decided to just do it on the product page. It's not really a bug, that's just the way it is.

This makes sense to me, especially if you are loading many products on one page, but like I mentioned, I will only ever have one product on one page. And I understand based on your response above, that what I'm asking for seems to go against the grain of HikaShop, but I'm extremely hopeful you can help me achieve a solution.

A couple of theories I have are below, but honestly, I'm no PHP expert so I don't know if this is even possible.

1) Display the product page in the {loadposition} rather than the product listing. (Because both the product listing and product page have the exact same info except the variants &amp; quantity, it makes sense logically to me, to remove the product listing from the entire process, instead of the product page).

2) Rework what the module displays. For instance, there are options in the module to display Random Items, 'Add to Cart' button, Link to product page, and Display price. Could we have an option to display variants? If this is possible, could we change the "Show Options" button to "Add to Cart" and direct to the cart, rather than the product page? I understand this would take quite a bit of code rework, and my guess for a place to start would be to change/add these things:

- Add something like this to the modules/zzparams.php view, perhaps? Code:

&lt;td&gt; &lt;?php echo $this-&gt;orderType-&gt;display($this-&gt;control.'[characteristics]',$this-&gt;characteristics,'product');?&gt; &lt;/td&gt;
- Add something like this to the product listing view: Code:

&lt;?php } if(!empty($this-&gt;element-&gt;characteristics)){ ?&gt;&lt;span id="hikashop_product_characteristics" class="hikashop_product_characteristics"&gt;&lt;?php echo $this-&gt;characteristic-&gt;displayFE($this-&gt;element,$this-&gt;params); ?&gt;&lt;/span&gt;&lt;br /&gt;&lt;?php } $form = ''; ?&gt;
- Somehow change the "Show Options" text and destination?? Not sure where to do this.

Obviously, these are my wild guesses, but I honestly have no idea where to start and how much I'm asking really requires. If possible, could you detail what code needs to be added or changed to make this possible? I'd really appreciate it!

Thanks for all of your hard work -- your product is amazing!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzEwODI3LWRpc3BsYXktdmFyaWFudC1vcHRpb25zLW9uLXByb2R1Y3QtbGlzdGluZz90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[jaime815](/forum/user/1555-jaime815 "View jaime815's Profile")**
- [![jaime815's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/1555-jaime815 "View jaime815's Profile") Topic Author
- [ Offline](/forum/user/1555-jaime815)

Less More

- Posts: 7
- Thank you received: 0
-
-

15 years 7 months ago [\#10828](#10828) by [jaime815](/forum/user/1555-jaime815 "View jaime815's Profile")  Replied by *[jaime815](/forum/user/1555-jaime815 "View jaime815's Profile")* on topic *[Re: Display variant options on product listing](/forum/4-how-to/10827-display-variant-options-on-product-listing#10828 "Hi there,  I've been searching for an answer to my question on the forum, and haven't quite found a solution yet. However, I do apologize if this question is redundant in any way, and if I have missed any documentation or help.  Also, if it's necessary to help, I'm using the &quot;Essentials&quot; version.  Basically what I'm trying to do is cut out the product page from the entire purchasing process. I'm using {loadposition} to load only one product in each article, and each product will require variants. As of now, in the article, it displays the &quot;Show Options&quot; button which then takes them to the product page, which then displays the &quot;Add to Cart&quot; button. My products are so simple in nature, that the product page does not show the customer any new information, except the ability to choose their option/variant. To save the customer time, and to reduce this process, I'm hopeful that I can get the variants to display on the product listing, and that the button would no longer say &quot;Show Options,&quot; but would say &quot;Add to Cart&quot; and take them directly to the cart, much like products that don't have variants.  I read another post here on the forum, where you gave this response:  This makes sense to me, especially if you are loading many products on one page, but like I mentioned, I will only ever have one product on one page. And I understand based on your response above, that what I'm asking for seems to go against the grain of HikaShop, but I'm extremely hopeful you can help me achieve a solution.  A couple of theories I have are below, but honestly, I'm no PHP expert so I don't know if this is even possible.  1) Display the product page in the {loadposition} rather than the product listing. (Because both the product listing and product page have the exact same info except the variants &amp; quantity, it makes sense logically to me, to remove the product listing from the entire process, instead of the product page).  2) Rework what the module displays. For instance, there are options in the module to display Random Items, 'Add to Cart' button, Link to product page, and Display price. Could we have an option to display variants? If this is possible, could we change the &quot;Show Options&quot; button to &quot;Add to Cart&quot; and direct to the cart, rather than the product page? I understand this would take quite a bit of code rework, and my guess for a place to start would be to change/add these things:  &#42; Add something like this to the modules/zzparams.php view, perhaps?  &#42; Add something like this to the product listing view:  &#42; Somehow change the &quot;Show Options&quot; text and destination?? Not sure where to do this.  Obviously, these are my wild guesses, but I honestly have no idea where to start and how much I'm asking really requires. If possible, could you detail what code needs to be added or changed to make this possible? I'd really appreciate it!  Thanks for all of your hard work -- your product is amazing!")*

It appears the PHP code was stripped from my original post above. I'll try again to use the code tags, and see if it works.
Code:

&lt;td&gt; &lt;?php echo $this-&gt;orderType-&gt;display($this-&gt;control.'[characteristics]',$this-&gt;characteristics,'product');?&gt; &lt;/td&gt;

Code:

&lt;?php } if(!empty($this-&gt;element-&gt;characteristics)){ ?&gt;&lt;span id="hikashop_product_characteristics" class="hikashop_product_characteristics"&gt;&lt;?php echo $this-&gt;characteristic-&gt;displayFE($this-&gt;element,$this-&gt;params); ?&gt;&lt;/span&gt;&lt;br /&gt;&lt;?php } $form = ''; ?&gt;

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzEwODI3LWRpc3BsYXktdmFyaWFudC1vcHRpb25zLW9uLXByb2R1Y3QtbGlzdGluZz90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86326
- Thank you received: 14288
-
-

15 years 7 months ago [\#10849](#10849) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Display variant options on product listing](/forum/4-how-to/10827-display-variant-options-on-product-listing#10849 "Hi there,  I've been searching for an answer to my question on the forum, and haven't quite found a solution yet. However, I do apologize if this question is redundant in any way, and if I have missed any documentation or help.  Also, if it's necessary to help, I'm using the &quot;Essentials&quot; version.  Basically what I'm trying to do is cut out the product page from the entire purchasing process. I'm using {loadposition} to load only one product in each article, and each product will require variants. As of now, in the article, it displays the &quot;Show Options&quot; button which then takes them to the product page, which then displays the &quot;Add to Cart&quot; button. My products are so simple in nature, that the product page does not show the customer any new information, except the ability to choose their option/variant. To save the customer time, and to reduce this process, I'm hopeful that I can get the variants to display on the product listing, and that the button would no longer say &quot;Show Options,&quot; but would say &quot;Add to Cart&quot; and take them directly to the cart, much like products that don't have variants.  I read another post here on the forum, where you gave this response:  This makes sense to me, especially if you are loading many products on one page, but like I mentioned, I will only ever have one product on one page. And I understand based on your response above, that what I'm asking for seems to go against the grain of HikaShop, but I'm extremely hopeful you can help me achieve a solution.  A couple of theories I have are below, but honestly, I'm no PHP expert so I don't know if this is even possible.  1) Display the product page in the {loadposition} rather than the product listing. (Because both the product listing and product page have the exact same info except the variants &amp; quantity, it makes sense logically to me, to remove the product listing from the entire process, instead of the product page).  2) Rework what the module displays. For instance, there are options in the module to display Random Items, 'Add to Cart' button, Link to product page, and Display price. Could we have an option to display variants? If this is possible, could we change the &quot;Show Options&quot; button to &quot;Add to Cart&quot; and direct to the cart, rather than the product page? I understand this would take quite a bit of code rework, and my guess for a place to start would be to change/add these things:  &#42; Add something like this to the modules/zzparams.php view, perhaps?  &#42; Add something like this to the product listing view:  &#42; Somehow change the &quot;Show Options&quot; text and destination?? Not sure where to do this.  Obviously, these are my wild guesses, but I honestly have no idea where to start and how much I'm asking really requires. If possible, could you detail what code needs to be added or changed to make this possible? I'd really appreciate it!  Thanks for all of your hard work -- your product is amazing!")*

Hi,

Option 1 would be in the realm of possibilities. You could just create a new hikashop content module and change the code in it in order to display the file show of the view product.
Right now, you have that line:
echo hikashop::getLayout($params-&gt;get('content_type'),'listing',$params,$js);

that you would replace by:
echo hikashop::getLayout('product','show',$params,$js);

Before that, you would have to add something like this:
JRequest::setVar('cid',XXX);
where XXX is the id of your product so that the system knows which product to load.

Option 2 is not possible. Just adding a few lines in the views to display the data is not enough because the data itself is not loaded. That would require a big chunk of code to be added...

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzEwODI3LWRpc3BsYXktdmFyaWFudC1vcHRpb25zLW9uLXByb2R1Y3QtbGlzdGluZz90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.054 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
