Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 Customization
 2 items in one listing?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

exigant
Starting Member

14 Posts

Posted - June 12 2008 :  23:31:13  Show Profile  Reply with Quote
I have items in my cart that are sold by the pack and by the case. Right now the cart has 1 item (with a ccode of say 1000) being sold as a pack and then right below it is the same item, but being sold as a case (with a ccode of 1000C). Is there a way to template 1 item to show up so there is 1 photo, 1 name, but 2 order buttons... one for the "pack" item ccode 1000 and one for the "case" item ccode 1000C?

norik000
Starting Member

USA
43 Posts

Posted - June 13 2008 :  01:06:01  Show Profile  Visit norik000's Homepage  Reply with Quote
I have done this, it is very easy,

Here is a quick method, of course you can use different fields to store your data, I just tell you the method.

in the pother3 form input the product id of the other item you would like to sell

ie: id item pother3 template
1 1000 2 2button_template.html
2 1000c

then add these stuff to your regular template and save it as 2button_template.html
<form name="different name" action="shopaddtocart.asp">
<!-- other form stuff -->
<input type="hidden" name="productid" value="pother3" />
<input type="submit" value="order">
</form>


does it make sense?

-------------------------------
www.Parscat.com
-------------------
Fedex Live Shipping Calculator + Freight
http://www.vpasp.com/virtprog/vpaspforum/topic.asp?TOPIC_ID=11363
-------------------
Go to Top of Page

exigant
Starting Member

14 Posts

Posted - June 14 2008 :  01:12:33  Show Profile  Reply with Quote
Thanks for the quick reply. It's close, but I'm doing something wrong because it's not quite there. I'm getting an error that says "Product ID must be numeric" when I click on either of my order buttons (it works fine with just one or the other showing). Here is the code I used:

<td width="30%" align="right" valign="top">
<strong>[pother1][ccode]</strong><br>
<strong>[getlang langproductprice]:</strong> <span class='price'>
[FORMATCUSTOMERPRICE cprice]
</span><br />
$ <strong>[getlang langproductretailprice]: </strong><strike>[formatcurrency retailprice]</strike><br /><br />
[formatquantity sub]
[formatbutton sub]<br><br>
$ <strong>[pother2]</strong><br>
$ [pother4]<br><br>
<form name="casename" action="shopaddtocart.asp" method="post">
<input class="txtfield" type="text" maxlength="4" size="3" value="1" name="quantity" />
<input type="hidden" name="productid" value="[pother3]">
<input type="submit" value="Order">
</form>
</td>

For reference, pother1 & pother2 just have some temporary formating text, pother3 is the catalogid of the case and pother4 is just the price. Any idea why it's not working?

Also is there a way to call say a price of another item? Like instead of having to type in the price of 1000C in pother4, is it possible to reference the price located on ccode 1000C for display purposes only? I know the order button with have it, but I want to show the price on the second item within the product listing of ccode 1000.

By the way... I'm using Cart Version 6.5 since I haven't mentioned that yet.

Edited by - exigant on June 14 2008 10:16:31
Go to Top of Page

exigant
Starting Member

14 Posts

Posted - June 15 2008 :  23:44:51  Show Profile  Reply with Quote
Saw some other posts that mentioned that this "Product ID must be numeric" error is a problem with the shopdisplayproducts.asp which is what I'm using. This is where the client wants to leave the ordering for his products (they don't want to bother going to each individual item). I see that I need to use [formatquantity sub] and [formatbutton sub] but that only gets me to 1 order button. I see how the form post is being added to the end of each template listing, but I can't find where this is being set up to add to it. Any one have an idea how to make this work on the shopdisplayproducts page?

***************************
Currently Running Cart Version 6.5
Go to Top of Page

exigant
Starting Member

14 Posts

Posted - June 20 2008 :  11:56:08  Show Profile  Reply with Quote
OK, I figured it all out. If anyone else is interested in putting more then 1 Order Button into each product on the shopdisplayproducts.asp page then here is how to do it. First on this page there is already the product you have showing being called from the database, so you might as well put that Order button first using the [formatbutton sub] function. So open up the tmp_productformat.htm template and you'll probably already see it somewhere there. Now right after that function you need to put in a </form> which is where my problem was coming from. Now you are free to put in as many other order buttons you want into this template. So use this code (or something along the lines):

<form name="name_of_choice" action="shopaddtocart.asp" method="post">
<input class="txtfield" type="text" maxlength="4" size="3" value="1" name="quantity" />
<input type="hidden" name="productid" value="[pother3]">
<input type="submit" value="Order">
</form>


Note the name field is anything you want, the line:

<input class="txtfield" type="text" maxlength="4" size="3" value="1" name="quantity" />

could probably be replaced by [formatquantity sub] but all that does is put the same line into your page, so I cut out the middle man on this part (and I didn't want to deal with any more unknowns ), and lastly the [pother3] is just where I put the catalogid for the product I'm selling with this button. On the post above I used the other 'pother#' variables to put in things like Price for the item I'm selling and strings like "Item #: 15767C" etc. So use these or don't, it's just what I did. Now that you've got all of that, you can save this template to another name (I just changed mine to tmp_productformat2.htm) and whenever you need to call it, you can put this into the Template Listing advanced field within the product itself.

NOW YOU AREN'T DONE YET! I hope you have kept reading because you aren't quite done with your coding. You need to change one more thing. Open the file shopproductformat_template.asp and look around line 32 for the line:

response.write "<input type=""hidden"" name=""productid"" value=""" & lngCatalogId & """ />"

You want to copy this line and paste it right in the if statement above it under the line that says:

response.write "<form action=""" & getconfig("xmysite") & "shopaddtocart.asp"" method=""post"">"

which was line 27 for me. So you'll be pasting it to line 28. Then go back down to line 33 (the line you copied will have moved from 32 since you inserted it above) and comment it out by placing a single quote in front of the line like this:

'response.write "<input type=""hidden"" name=""productid"" value=""" & lngCatalogId & """ />"

Save the file and now finally you are done. Hope this helped!

***************************
Currently Running Cart Version 6.5
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00