Print Page | Close Window

Add to Cart in ViewCategories.asp

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Customizing ProductCart
Forum Description: Exchange messages with other users that are customizing ProductCart.
URL: https://forum.productcart.com/forum_posts.asp?TID=843
Printed Date: 02-May-2024 at 7:57am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Add to Cart in ViewCategories.asp
Posted By: fidjiti
Subject: Add to Cart in ViewCategories.asp
Date Posted: 29-May-2007 at 10:02pm
Does anyone know how to add the "add to cart" buttons to each product by the "more details" link area in the category pages before actually going to the product pages.

I don't need the qty box, just the add to cart button which will add a default number (1) of that item to their cart.

I downloaded the file which is found on the developers page which talks about putting an add to cart button anywhere: http://www.earlyimpact.com/productcart/support/developers.as p
But I don't know what I am supposed to do with it because there isn't a read-me file included. :(

I would like my category pages:
http://www.fidjiti.com/shop/pc/viewCategories.asp?idCategory =311
to have the add to cart button like this one below:
http://www.thesimpleleaf.com/ec/pc/viewcat_p.asp?idCategory= 3

Maybe there is a simple code I can add to the viewCategories.asp file. Please help if you can.
Thanks!!!!
 

-------------
Linda - I wish I knew ASP.
To view my ever evolving site click the "www" button below. :)



Replies:
Posted By: netprofits
Date Posted: 30-May-2007 at 7:26am

For the horizontal layout, you need to modify: pcShowProductH.asp
At the bottom of the routine, look for the following code:


  <p class="pcShowProductLink">
   <a href="viewPrd.asp?idcategory=<%=pIdCategory%>&idpr oduct=<%=pIdProduct%>" <%if scStoreUseToolTip="1" then%>onmouseover="javascript:document.getPrd.idproduct.v alue='<%=pIdProduct%>'; sav_callxml='1'; return runXML1('prd_<%=pIdProduct%>');" onmouseout="javascript: sav_callxml=''; hidetip();"<%end if%>><img src="<%=rslayout("morebtn")%>"></a>
  </p>

and change it to:


<p class="pcShowProductLink">
   <a href="viewPrd.asp?idcategory=<%=pIdCategory%>&idpr oduct=<%=pIdProduct%>" <%if scStoreUseToolTip="1" then%>onmouseover="javascript:document.getPrd.idproduct.v alue='<%=pIdProduct%>'; sav_callxml='1'; return runXML1('prd_<%=pIdProduct%>');" onmouseout="javascript: sav_callxml=''; hidetip();"<%end if%>><img src="<%=rslayout("morebtn")%>"></a>
      <% '== Add to Cart button on category pages %>
   <br>
      <a href="instPrd.asp?idproduct=<%=pIdProduct%>"><im g src="<%=rslayout("addtocart")%>"></a>
</p>

Make sure to change "im g src" to "img src". For some reason the editor is adding extra spaces.

Here is the web site we made the modification to:
http://www.myteamwatches.com/store/pc/home.asp - http://www.myteamwatches.com/store/pc/home.asp



-------------
NetProfits Internet Consulting

Certified ProductCart Developer

http://www.nicwebdesign.com" rel="nofollow - Our Site


Posted By: fidjiti
Date Posted: 30-May-2007 at 4:25pm
Netprofits, you my friend, are a genius! I couldn't look like a pro without you. :) Thanks for the fabulous help.

Oh and you'll have to delete the space between: "&idpr oduct=<%" so the word product would be 1 word.

Check mine out: http://www.fidjiti.com/shop/pc/viewCategories.asp?idCategory=3 - http://www.fidjiti.com/shop/pc/viewCategories.asp?idCategory =3

(I still need to edit the stock button images)






-------------
Linda - I wish I knew ASP.
To view my ever evolving site click the "www" button below. :)


Posted By: jenbeast
Date Posted: 12-June-2007 at 7:22pm
Hi-I wonder if you could help me, too, netprofits? I'm not sure how to apply
the above code to my particular product layout:

http://www.valentinopads.com/productcart/pc/viewCategories.a sp?
idCategory=96

I would also like to put an 'add to cart' button next to each product-your
help is greatly appreciated!


Posted By: netprofits
Date Posted: 13-June-2007 at 10:43am

You really shouldn't have an add to cart button for each product in that view as it is expecting customers to enter quantities for one or more products and then click the Add To Cart button at the bottom.

You would probably want to use the Display items vertically (list view) which uses pcShowProductP.asp. Find the table cell where you want the add to cart button and just insert this code:

<a href="instPrd.asp?idproduct=<%=pIdProduct%>"><im g src="<%=rslayout("addtocart")%>"></a>



-------------
NetProfits Internet Consulting

Certified ProductCart Developer

http://www.nicwebdesign.com" rel="nofollow - Our Site


Posted By: mrondael
Date Posted: 29-June-2007 at 11:16am

Hello NetProfits

I'm using ProductCart 3.x  I like the vertical view with the add to cart button but would like to customize this view to include simple options.  How would I modify the page.

Thanks!



Posted By: dwatch
Date Posted: 23-July-2007 at 11:50am

Netprofits, how can we implement the check to the add to cart code so that if the product has required options it displays an alert and advises the customer to hit more details and select the opitons?



Posted By: netprofits
Date Posted: 23-July-2007 at 12:14pm

For these last 2 posts...It would be a lot of work to tweak any of the category views to show product options. You would need to look in the viewPrd.asp, viewPrdCode.asp and probably other files to see what all is needed to work with product options. If you are not an experience developer, I wouldn't recommend this. There are a lot of variables set in different places that would all need to be set correctly in the category display pages to handle options.

In the instPrd.asp (which adds an item to the cart) you would need to find the code in viewPrdCode.asp (most likely) that checks for product options and then add that code to instprd.asp when trying to add an item.

In the end...if you have products with options, it is easier to just not show the add to cart button on category pages.



-------------
NetProfits Internet Consulting

Certified ProductCart Developer

http://www.nicwebdesign.com" rel="nofollow - Our Site


Posted By: dwatch
Date Posted: 23-July-2007 at 12:16pm

hey netprofits, can you provide quote such as:

if the product has options, is apparell or is BTO, then dont display the add to cart button for that product



Posted By: Matt
Date Posted: 23-July-2007 at 1:04pm

This feature has been added to ProductCart v3.1.  The "Add to Cart" button will also be hidden when there are required options, fields, or the product is Apparel.  There is no definitive release date for 3.1, though we are expecting sometime in August.   



Posted By: jenbeast
Date Posted: 23-July-2007 at 1:40pm
thanks so much for the advice, netprofits!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net