Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 08-25-2008 15:14:55

Shopper
Member
Registered: 09-10-2007
Posts: 94

Remote Add of Product Price

Hi,

we have the following CCP version installed: GBU 6.0.5 and KHXC 6.6.4 and use the following form fields to add products remotely to the shopping cart:

<form action="/khxc/index.php" method="post" id="gbu0--prodaddtocart01" />
<input type="hidden" name="gbu0--prodaddtocart--ref" id="gbu0--prodaddtocart--ref" value="Order_No_1234" />
<input type="hidden" name="gbu0--prodaddtocart--addtype" id="gbu0--prodaddtocart--addtype" value="SINGLE" />
<input type="hidden" name="app" id="app" value="gbu0" />
<input type="hidden" name="ns" id="ns" value="addcart" />
<input name="gbu0--prodaddtocart--quantity" type="text" id="gbu0--prodaddtocart--quantity" value="<?php $qty ?>" size="4" maxlength="4" />
<input type="submit" name="SUBMIT01" id="gbu0--prodaddtocart--SUBMIT01" value="Add to Cart" onclick="return DisableSubmit('gbu0--prodaddtocart');" />
</form>

This gets the product information from the database gbu0_prod and displays it in the shopping cart.

Now I want to send also the price of the product in a hidden field and overwrite the price info from the database.

Does anybody know what name and id are needed? I tried many different possibilities with no success.

Thanks for any help.

Offline

 

#2 08-26-2008 05:45:26

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Remote Add of Product Price

Look at the example for remote add named productform.html which you'll find in the public media/gbu0/examples directory.

Offline

 

#3 08-26-2008 15:35:20

Shopper
Member
Registered: 09-10-2007
Posts: 94

Re: Remote Add of Product Price

Thanks Dave,

This document I almost know by heart.
We have another shop installed with the following next software versions: GBU 6.0.6 and KHXC 6.6.5
There I can add to the cart what I want, but have to send all necessary information with the link "Add to Cart" - i.e. price, number, description, shipping and so on. The product even does not have to be in the database because the information for the product is not taken from the database.

<form action="/khxc/index.php" method="post" id="remoteadd" />
<input class="wish_button" type="submit" name="WISHLIST" id="WISHLIST" value="Add To Wish List" />
<input type="hidden" name="app" id="app" value="gbu0" />
<input type="hidden" name="ns" id="ns" value="addcart" />
<input type="hidden" name="cart_api" id="cart_api" value="Y" />
<input type="hidden" name="price" id="price" value="50" />
<input type="hidden" name="quantity" id="quantity" value="1" />
<input type="hidden" name="delivery_method" id="delivery_method" value="D" />
<input type="hidden" name="name" id="name" value="Product_Name" />
<input type="hidden" name="number" id="number" value="Order_Number" />
<input type="hidden" name="usetaxcountry" id="usetaxcountry" value="H" />
<input type="hidden" name="dlfile" id="dlfile" value="File_Name" />
<input type="submit" name="SUBMIT" id="SUBMIT" value="Add to Order List" class="buy_button_1" onclick="return DisableSubmit('number');" />
</form>

But with the software versions and the form fields mentioned in my first post, the cart pulls the product information from the database and I cannot overwrite this information.

The form fields of one shop cannot be used for the other and vice versa even though the product databases gbu0_prod have the same content.

Is there in general a difference in defining form fields so that the product is pulled from the database or a product added which is even not in the database?

Offline

 

#4 08-26-2008 16:54:53

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Remote Add of Product Price

Remote products which are added to the cart get a prefix of "REMOTE-" when the cart and checkout scripts see that they will not try to check it against the database. Items which are added from the database do not get this prefix and are thus checked against the database for current stock and price. The trick is to make ccp think that an item add from the database is coming from a remote entry which means you would need to pass the amount along with another field and mod the cart script so that when it see the trigger field you are suppling to update the amount field with the information supplied and then prefix the id with "REMOTE-" after it has pulled the other information for the product, simple.

John

Offline

 

#5 08-26-2008 22:10:56

Shopper
Member
Registered: 09-10-2007
Posts: 94

Re: Remote Add of Product Price

Thanks John,

That's more than I've learned up to now. Any modification of the cart is not yet something where I feel save.
If I don't find the right way I will ask again.

Offline

 

Board footer