Announcement

Collapse
No announcement yet.

Action_AddProductToBasket() From Third Party Site

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Action_AddProductToBasket() From Third Party Site

    Can we use Miva to add products to the basket from a third party site?

    I created a simple page APTB with two lines of code:

    Code:
    <mvt:do file="g.module_merchant" name="g.adpr_callback" value="Action_AddProductToBasket()" />
    <meta http-equiv="refresh" content="1;url=https://www.mydomain.com/mm5/merchant.mvc?Screen=BASK">
    Then posted a request:

    And the item was added to the basket.

    Does the uri need any additional parameters like basket_id, session_id, tokens?

    Is there a JSON API for this?
    http://www.alphabetsigns.com/

    #2
    You may not need anything that complex. You can add an item to the basket with a URL that includes parameters Action=ADPR&Product_Code=XXXXX. You can add additional parameters for quantity and attribute selections. You can add Screen=BASK so that users will land on the Basket Contents page, with the item already in their basket.
    Kent Multer
    Magic Metal Productions
    http://TheMagicM.com
    * Web developer/designer
    * E-commerce and Miva
    * Author, The Official Miva Web Scripting Book -- available on-line:
    http://www.amazon.com/exec/obidos/IS...icmetalproducA

    Comment


      #3
      Thanks Kent.

      I am trying to post the request from a different domain and am concerned about dropped baskets. The customer may leave the merchant environment and continue to shop from the third party domain. Do you know if the uri needs a basket or session id or some type of tokenization to prevent dropped baskets?

      My other thought is to call the third party domain into the merchant environment through an iFrame. Would basket and session ids then be present?

      I created the page template so later on I can add validation before the ADPR Action.

      http://www.alphabetsigns.com/

      Comment


        #4
        Miva Merchant uses cookies to track a shopper's session ID. So customers should be able to pop back and forth from Miva to the other domain without anything getting lost, as long they don't stay away from the store longer than the standard basket timeout.
        Kent Multer
        Magic Metal Productions
        http://TheMagicM.com
        * Web developer/designer
        * E-commerce and Miva
        * Author, The Official Miva Web Scripting Book -- available on-line:
        http://www.amazon.com/exec/obidos/IS...icmetalproducA

        Comment


          #5
          Thanks Kent.

          It seems easier than I thought.

          Dan
          http://www.alphabetsigns.com/

          Comment

          Working...
          X