Add to Cart Button

General ShopSite user discussion

Add to Cart Button

Postby JuliefromWY » Wed Oct 24, 2012 12:01 pm

I have a couple of items I do not want the "Add to Cart" Button to show. I am using the Classy Template. I have made a copy of the template and have attempted to delete what I thought was the code for the add to cart but it doesn't seem to be working so far. The button still shows on my product even though it doesn't work. What am I missing to get the button to disappear completely? Thanks!!
JuliefromWY
 
Posts: 9
Joined: Wed Oct 24, 2012 11:42 am

Re: Add to Cart Button

Postby Jim » Wed Oct 24, 2012 12:24 pm

There are 20 different places in the classy_pr_template.sst where the add to cart button could be coming from. It depends on what options you have enabled for the product like order options, variable pricing, moreinfo page etc which section you will need to modify.

It might be easier to just copy the parts that you do want and put them into a new template. If you can post a link to the page the product is on and tell us what you want to see compared to what is on the page it would be easier to get a solution.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Add to Cart Button

Postby JuliefromWY » Wed Oct 24, 2012 12:55 pm

https://shopsite.purehost.com/ss11.0/ss/preview.cgi?&ran1=260&ran2=460&page=34

I hope this is what you need! I'm just now updating to the template format so I haven't published to the web yet.
I just want the product that says "call for availability" to not have the "add to cart" button associated with it.

Thanks again!
JuliefromWY
 
Posts: 9
Joined: Wed Oct 24, 2012 11:42 am

Re: Add to Cart Button

Postby Jim » Wed Oct 24, 2012 12:58 pm

That url won't work because you have to be logged in to the backoffice to use the Preview a page feature.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Add to Cart Button

Postby Jim » Wed Oct 24, 2012 2:12 pm

Looking at the template most of the sections where the Add to Cart is located have <!-- Add to Cart Button --> If you do a search for <!-- Add to Cart Button --> that will put you at the beginning of the first type of code. You can delete everything between the <tr> before the <!-- Add to Cart Button --> and the closing </tr> after the [-- END_IF --] and replace it with your text or image for "Call for Availability" inside of <td> </td>
So it would go from this
Code: Select all
<!-- Add to Cart Button -->
          [-- IF AddImage? --]
            <td class="pr_addtocart_button"><input class="pr_addtocart_button" type="image" value="submit" [-- AddImage --] alt="[-- VAR.pr_addtocart_text --]"></td>
          [-- ELSE --]
            <td class="pr_addtocart_button"><input class="pr_addtocart_button" type="submit" value="[-- AddText --]"></td>
          [-- END_IF --]
To this
Code: Select all
<!-- Add to Cart Button -->
        <tr>
         <td>Call for Availablity</td>
        </tr>

There are at least two instances of this next type of code. Search for "ELSE_IF AddImage?" which will put you at the start of the code. Since the logic in this section is complex I would change it from this.
Code: Select all
[-- END_IF --]
    [-- ELSE_IF AddImage? --]
          <td class="pcs_product_add_to_cart"><a class="pcs_addtocart_button" href="[-- PRODUCT.AddToCartURL --]"><img class="pcs_addtocart_button" alt="Add to Cart" [-- AddImage --] border="0"></a></td>
    [-- ELSE --]
          <td class="pcs_product_add_to_cart"><a class="pcs_addtocart_button" href="[-- PRODUCT.AddToCartURL --]">[-- AddText --]</a></td>
    [-- END_IF --]
to this
Code: Select all
  [-- END_IF --]
    [-- ELSE_IF AddImage? --]
          <td class="pcs_product_add_to_cart">Call for Availablity</td>
    [-- ELSE --]
          <td class="pcs_product_add_to_cart">Call for Availability</td>
    [-- END_IF --]


There is a third type of code for the add to cart if Google Analytics is enabled.
Code: Select all
<!-- START Buttons - No Form -->
          <tr>
          [-- IF AddImage? --]
            [-- IF ANALYTICS_MULTI_DOMAIN --]
            <td class="pr_addtocart_button">
            <script type="text/javascript" language="JavaScript">
              document.write('<a class="pr_addtocart_button" href="javascript:__utmLinker(\'[-- PRODUCT.AddToCartURL --]\');"><img class="pr_addtocart_button" alt="[-- VAR.pr_addtocart_text --]" [-- AddImage --] border="0"></a>');
            </script>
            <noscript>
              <a class="pr_addtocart_button" href="[-- PRODUCT.AddToCartURL --]"><img class="pr_addtocart_button" alt="[-- VAR.pr_addtocart_text --]" [-- AddImage --] border="0"></a>
            </noscript>
            </td>
            [-- ELSE --]
            <td class="pr_addtocart_button"><a class="pr_addtocart_button" href="[-- PRODUCT.AddToCartURL --]"><img class="pr_addtocart_button" alt="[-- VAR.pr_addtocart_text --]" [-- AddImage --] border="0"></a></td>
            [-- END_IF --]
          [-- ELSE --]
            [-- IF ANALYTICS_MULTI_DOMAIN --]
            <td class="pr_addtocart_button">
            <script type="text/javascript" language="JavaScript">
              document.write('<a class="pr_addtocart_button" href="javascript:__utmLinker(\'[-- PRODUCT.AddToCartURL --]\');">[-- AddText --]</a>');
            </script>
            <noscript>
              <a class="pr_addtocart_button" href="[-- PRODUCT.AddToCartURL --]">[-- AddText --]</a>
            </noscript>
            </td>
            [-- ELSE --]
            <td class="pr_addtocart_button"><a class="pr_addtocart_button" href="[-- PRODUCT.AddToCartURL --]">[-- AddText --]</a></td>
            [-- END_IF --]
          [-- END_IF --]
          </tr>
                                                 
Since they won't be adding to the cart from the page there is no need for the Google code, so I think that could all be replaced with this
Code: Select all
<!-- START Buttons - No Form -->
          <tr>
                <td>Call for Availability
                </td>
          </tr>
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Add to Cart Button

Postby JuliefromWY » Thu Oct 25, 2012 11:41 am

Yeah! It worked! Thanks for your help!
JuliefromWY
 
Posts: 9
Joined: Wed Oct 24, 2012 11:42 am


Return to User Forum

Who is online

Users browsing this forum: No registered users and 120 guests