Announcement

Collapse
No announcement yet.

Pass Price in Add to Cart URL

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

    Pass Price in Add to Cart URL

    Hi all,

    I have a site with a complex product configurator. I am able to pass the quantity in via the link below, but I need to pass in the price to the Miva store as well since the Price dynamically changes. I envision that I will have other attributes to send in the future. How would I pass in the Price so Miva can recognize this in the cart?

    <a class="button" href="http://mysite.mivamerchant.net/mm5/m...ction=ADPR"><b class="text">ADD TO CART</b></a>

    Thanks!

    Kelly

    #2
    Re: Pass Price in Add to Cart URL

    Can't pass the price in via a URL, at least not directly. (If you could, than any 13 year old could get the product at whatever price they wanted.)

    At the very least, you need to use a module to take some tokenized indication of price, and do your own basket table manipulation. A better method would be leveraging the built in discounting functions to achieve the desired result so you only have to use the module to interact with the Merchant API system. (Making direct database calls, while expedient, will eventually get you into trouble.)
    Bruce Golub
    Phosphor Media - "Your Success is our Business"

    Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
    phosphormedia.com

    Comment


      #3
      Re: Pass Price in Add to Cart URL

      Thanks Bruce,

      Do you have a link/resource for using discounting functions?

      Regards,

      Kelly

      Originally posted by Bruce - PhosphorMedia View Post
      Can't pass the price in via a URL, at least not directly. (If you could, than any 13 year old could get the product at whatever price they wanted.)

      At the very least, you need to use a module to take some tokenized indication of price, and do your own basket table manipulation. A better method would be leveraging the built in discounting functions to achieve the desired result so you only have to use the module to interact with the Merchant API system. (Making direct database calls, while expedient, will eventually get you into trouble.)

      Comment


        #4
        Re: Pass Price in Add to Cart URL

        I've had this same situation where a complex product page was calculating the price via JavaScript. To get around the security issue, I created a new page template called BASKCALC.

        On the custom product page I edit the forms hidden <input> tags. Action="ADRP" and SCREEN="BASKCALC". I pass all the option selections needed to the new template and calculate the price, essentially duplicating the JavaScript calculations within the page template.

        Finally, the BASKCALC then uses the do command to call a compiled function that updates the price of the last item in the basket.

        Finally the BASKCALC page uses <mvt:item name="ry_toolbelt" param="screen|BASK" /> to output the basket page, but you can also use toolkits render command.
        Ray Yates
        "If I have seen further, it is by standing on the shoulders of giants."
        --- Sir Isaac Newton

        Comment


          #5
          Re: Pass Price in Add to Cart URL

          I had a client with a similar problem recently. I wrote a module for them that allows the store to recognize links with an extra URL parameter. This parameter pre-selects the attributes when customers arrive at the page, causing the store to also display the correct price, image, etc. If something like that will work for you, you can drop me a line by email to discuss it in detail.

          Thanks --
          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


            #6
            Re: Pass Price in Add to Cart URL

            Not that I could just point too...most of what I know about the discounting function is by reading through the LSK.

            http://www.miva.com/support/downloads

            But its not for casual browsing.
            Bruce Golub
            Phosphor Media - "Your Success is our Business"

            Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
            phosphormedia.com

            Comment

            Working...
            X