"show details" and/instead "add to cart" button in category

Rate this topic: Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.
GK User
Thu Aug 10, 2017 8:21 pm
Reply with quote
Report this post
Hi,
In my products' category view, I'm able to see the product image, price and add to cart button.
Screen Shot 2017-08-10 at 20.19.07.png


However, in that page, when a user adds to cart a product that has different attributes available (size, color, ...), the options are not showed and the product is added to cart without that specification.
Screen Shot 2017-08-10 at 20.13.45.png



How to prevent this?
Is it possible, in products with different attributes

Option 1. to show "show options" instead of "add to cart" button (to force the user to open the product detail page)

OR

Option 2. open a pop-up window with the available options

OR

Option 3. Show the different options in the category view?

Thank you.

Eg. of "add to cart button" and "show details"
Screen Shot 2017-08-10 at 19.31.03.png
User avatar
Senior Boarder

teitbite
Wed Aug 16, 2017 12:36 pm
Reply with quote
Report this post
Hi

This is implemented already. When product has child products with different options an "Add to cart" buttons shows "Product details".

Please tell me the url to Your site so I'll check why it's not working like that for You.
User avatar
Moderator

GK User
Fri Aug 18, 2017 5:01 pm
Reply with quote
Report this post
Sent pm.

Thank you.
User avatar
Senior Boarder

teitbite
Thu Aug 24, 2017 2:44 pm
Reply with quote
Report this post
Hi

Haven You modified this layout ? I cannot find a presentation of it in code. It should be a VM category layout, but when I check code there is no add to cart or quantity options.

By default there should be just a link to the product as seen in the code I've attached. Please make sure to restore /html/com_virtuemart folder from newest template's files.
User avatar
Moderator

GK User
Mon Aug 28, 2017 4:07 pm
Reply with quote
Report this post
I'm sorry, I forgot about that.
Yes I did. I just restored the folder as you suggested and I remembered why I did it: the original files only show "product details", even if a product doesn't have different options.

I need it to show "product detail" if the client needs to make an choice or "add to cart" if there isn't any attribute to chose from.
User avatar
Senior Boarder

GK User
Mon Aug 28, 2017 4:46 pm
Reply with quote
Report this post
I'm checking the original files (/html/com_virtuemart) and I can't seem to find any add to cart or quantity options at all (.../category/default.php and .../categories/default.php).

This was the code that I used to show the "add to cart button" (placed in category/default.php):

Code: Select all
 <div class="addtocart-area">
      <form method="post" class="product js-recalculate" action="<?php echo JRoute::_ ('index.php?option=com_virtuemart',false); ?>">
         <div class="vm-customfields-wrap">
            <?php
            if(!empty($rowHeights['customfields'])) echo shopFunctionsF::renderVmSubLayout('customfields',array('product'=>$product,'position'=>'addtocart')); ?>
         </div>         
            <?php
            if (!VmConfig::get('use_as_catalog', 0)  ) {
               echo shopFunctionsF::renderVmSubLayout('addtocartbar',array('product'=>$product));
            } ?>
         <input type="hidden" name="option" value="com_virtuemart"/>
         <input type="hidden" name="view" value="cart"/>
         <input type="hidden" name="virtuemart_product_id[]" value="<?php echo $product->virtuemart_product_id ?>"/>
         <input type="hidden" name="pname" value="<?php echo $product->product_name ?>"/>
         <input type="hidden" name="pid" value="<?php echo $product->virtuemart_product_id ?>"/>
         <?php
         $itemId=vRequest::getInt('Itemid',false);
         if($itemId){
            echo '<input type="hidden" name="Itemid" value="'.$itemId.'"/>';
         } ?>
      </form>

   </div>

User avatar
Senior Boarder

GK User
Tue Aug 29, 2017 12:44 pm
Reply with quote
Report this post
This would be the perfect solution:
Add to cart button + pop up window with custom fields

https://www.tiendanimal.pt/racao-royal-canin-c-1_25_48.html
User avatar
Senior Boarder

teitbite
Wed Aug 30, 2017 3:25 pm
Reply with quote
Report this post
Hi

I agree, but we are not adding new functionality to components which are taked from other developers. All we do is creating a mathing style to our templates. If VM doesn't come with such functionality You will need to talk to them directly asking to extend it.
User avatar
Moderator

GK User
Wed Aug 30, 2017 6:20 pm
Reply with quote
Report this post
Yes, I understand.
When I first posted about this issue it was because I noticed differences between the behaviour with the template and using original VM files. But now I realised that it's not just a miss configuration or simple code issue.
I guess, in this matter, I preferred the VM 1.

Thank you anyway.
User avatar
Senior Boarder

teitbite
Sun Sep 03, 2017 11:32 am
Reply with quote
Report this post
Hi

Sorry I couldn't help more. Closing this thread now.
User avatar
Moderator


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.