PDA

View Full Version : Add 2 item to merchant.mvc?Action=ADPR


BebekTerbang
06-23-06, 02:38 AM
Hi guys,

I know when you call
merchant.mvc?Action=ADPR&product_code=test&category_code=testcat&quantity=1

I will add one item (test) from category testcat

How can I modify this if I want to add 2 item for example

add testA and testB directly ?

can I possibly do that ? how it will impact the quantity and the category ?

Thank you very much

Bruce - PhosphorMedia
06-23-06, 02:42 AM
ah, yea, change the quantity value in the url to '2'

BebekTerbang
06-23-06, 03:17 AM
hehehe

I know how to change the quantity, but can I add another item ?

for example i want to add a car and a truck with one button click

is that possible ?

Vic - WolfPaw Computers
06-23-06, 03:38 AM
You really cant, without getting tricky.

If you put two lines in your code like:
Action=ADPR&product_code=testa&category_code=testcat&quantity=1

and

Action=ADPR&product_code=testb&category_code=testcab&quantity=1

Your second line is going to overwrite the product_code and category_code variables. Thus losing your initial values.

dotCOM_host
06-23-06, 05:53 AM
Haven't tried it in v5, but Viking Coders did come up with a sample template for v4 in their excellent Category Page Template module which allows you to have a quantity box ont he category pages along with just one "add to basket" button to add multiple items all at once to the cart. Would be worth looking through the source code that template generates to see how they accomplished this feat, and see if it's doable in MM v5 the same way (or whether there was more to it and that's one of the features available only with the Category Page Templates module itself).

Vic - WolfPaw Computers
06-23-06, 05:58 AM
Yes, and it used a custom function to assign the variables.

No such module is currently available for MM5, and it cannot be done natively.

Bruce - PhosphorMedia
06-23-06, 07:05 AM
Correct. It used a proprietary function to accept the call, loop each product, and then call the standard ADPR API for each item. Not really that hard to build, but hasn't been done yet.

Vic - WolfPaw Computers
06-23-06, 07:18 AM
I would imagine, with Weiland's v5 Toolkit (http://www.emporiumplus.com/merchant2/merchant.mvc?Screen=PROD&Store_Code=wcw&Product_Code=1AA00223) and some clever programming, it can be duplicated in v5.

We could do it with OpenTokens in v4, and Weiland has come close to OpenTokens with his Toolkit (http://www.emporiumplus.com/merchant2/merchant.mvc?Screen=PROD&Store_Code=wcw&Product_Code=1AA00223). We're still playing with it. So far very nice.