Solved

Add to cart button missing?

Posted on 2011-09-04
13
495 Views
Last Modified: 2012-05-12
If you go to a product that has ONE item in the category there is no add to cart button at all.

Please see the live site here for an example

In categories "Surge Protectors" and "Test Meters" the add to cart button has dissapeared.

http://www.maxtemp.com.au/index.php?option=com_virtuemart&page=shop.browse&category_id=56&Itemid=1

and
http://www.maxtemp.com.au/index.php?option=com_virtuemart&page=shop.browse&category_id=6&Itemid=1

Please can you tell me how to FIX it please?
[7:08:34 AM] Amanda Watson:  
please use this as login for the site to see the products


aaabbb
password: aaabbb
0
Comment
Question by:Amanda Watson
  • 9
  • 4
13 Comments
 
LVL 11

Author Comment

by:Amanda Watson
ID: 36482604
By the way there has been some customisation here so I am pretty sure there would be a conditional statement saying when the add to cart button is to show and somehow it isn't showing when there is only one product, but where should I look for this..can anyone help?
0
 
LVL 12

Expert Comment

by:Panagiotis S
ID: 36482607
where do you want to add the add to cart button? to browse or flypage ?
0
 
LVL 11

Author Comment

by:Amanda Watson
ID: 36482617
browse page
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Expert Comment

by:Panagiotis S
ID: 36482638
put this
<?php echo $form_addtocart ?>
0
 
LVL 11

Author Comment

by:Amanda Watson
ID: 36482694
Thank you, yes the add to cart button is present on all the pages, EXCEPT for pages with only one item in their category

These are the files that have been edited...something is wrong with them so that the button isn't showing when there is only ONE item on the page...can you see where the problem is? addtocart-form.tpl.txt
browse-orderbyform.tpl.txt
browse-pagenav.tpl.txt
0
 
LVL 12

Expert Comment

by:Panagiotis S
ID: 36482702
no you have to put it in the browse page that you use in components\com_virtuemart\themes\centiva\templates\browse
0
 
LVL 11

Author Comment

by:Amanda Watson
ID: 36482724
IT is already in the browse page I am using.
That is not the problem
0
 
LVL 11

Author Comment

by:Amanda Watson
ID: 36482728
The add to cart button works on all pages as it is supposed to EXCEPT for pages with only one product, so because this site has been customised, I have attached the affected pages to see if you can figure out why the add to cart button shows on pages with more that one product to browse, but not on pages with only one product
0
 
LVL 12

Expert Comment

by:Panagiotis S
ID: 36482732
why did you put add to cart to the browse-orderbyform.tpl.txt ?
0
 
LVL 11

Author Comment

by:Amanda Watson
ID: 36482759
because that form has been amended when the the add to cart function was changed.
What changed was that the add to cart was moved to the top of the browse page, rather than being there for each product..(which is the norm for virtuemart)
0
 
LVL 11

Author Comment

by:Amanda Watson
ID: 36482762
the ps_cart and ps_attribute files were also amended but I don't think they are implicated in this error
0
 
LVL 11

Accepted Solution

by:
Amanda Watson earned 0 total points
ID: 36485930
<!--Modifications for one add to cart button-->
<div id="output2"></div>
<!--Modifications for one add to cart button end here-->
<form action="<?php echo $mm_action_url ?>index.php" method="post" name="addtocart" id="addtocart<?php echo $i ?>" class="addtocart_form" <?php if( $this->get_cfg( 'useAjaxCartActions', 1 ) && !$notify ) { echo 'onsubmit="handleAddToCart( this.id );return false;"'; } ?>>
<div style="width: 100%; text-align: right">

<input id="submitFirstToLast" type="submit" class="addtocart_button" value="Add to Cart" />
</div>

This needed to be added to browse_notables.tpl.php

instead of  browse_orderbyform.tpl.php
that fixed it
0
 
LVL 11

Author Closing Comment

by:Amanda Watson
ID: 36515706
I found the solution
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question