Miva Merchant Community Forums

  1. #1
    Join Date
    Nov 2008
    Posts
    164

    Default Possible to have attribute price be dynamic?

    I have a store where for any product listed.....a customer is allowed to select a color.

    Each product has a base price.
    There are two color type choices: Stock and Metallic.
    Stock colors are included in the base product price.

    Metallic colors however, are prices as an additional 1/2 of the base product price. For example, if the product is priced at $100, the metallic color upcharge would be $50.

    Right now I'm trying this color type as an attribute.

    Anyone have any idea on how best to do this? Is it possible in Miva? I don't want to have to hardcode the color pricing for obvious reasons.

    -Kevin
    Web Design and Development, Internet Marketing
    Lancer Media, Inc.

  2. #2
    Join Date
    Mar 2006
    Posts
    1,816

    Default Re: Possible to have attribute price be dynamic?

    This (and the other issues mentioned in your other post) can be solved with a custom module. If you want to do it without custom code, you could set up the attributes for a single prouct; then export the product as an XML provisioning file. Then you can do a big copy-and-paste to create a provisioning file that will add the attribute to every other product. It's not trivial, but it's a lot less work then manually creating the attributes by pointing and clicking.
    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

  3. #3
    Join Date
    Nov 2008
    Posts
    164

    Default Re: Possible to have attribute price be dynamic?

    Kent,

    My issues isn't creating the products and attributes themselves....maybe I wasn't clear.

    For this particular issue....is it possible in Miva to have an attribute have a dynamic price set. For example, 1/2 whatever the product price is. That way when we change the product price....we don't have to adjust attribute pricing as well....it will automatically get adjusted.

    -Kevin
    Web Design and Development, Internet Marketing
    Lancer Media, Inc.

  4. #4
    Join Date
    Aug 2006
    Location
    Gap, PA
    Posts
    572

    Default Re: Possible to have attribute price be dynamic?

    With Miva, anything is possible.

    I created attribute pricing as a percentage of the product price with the toolbelt.

    It requires a postaction page after the ADPR action to update the basket item price.

    The basic concept is to create a postaction page, do some initial data modeling, run an update query to the basket item table, then redirect to a response page.

    You may have to add some additional logic if you are using a basket combined pricing module.

    The other problem I had was multiplying a variable by itself, example: var1 = var1 * 1.5.

    It only took an hour to complete, after thinking about it for 7 hours ;)

    If you are not very familiar with MIVA actions and DB you should contact a developer like Kent.

    But with Miva, anything is possible.

  5. #5
    Join Date
    Nov 2008
    Posts
    164

    Default Re: Possible to have attribute price be dynamic?

    Quote Originally Posted by alphabet View Post
    With Miva, anything is possible.

    I created attribute pricing as a percentage of the product price with the toolbelt.

    It requires a postaction page after the ADPR action to update the basket item price.

    The basic concept is to create a postaction page, do some initial data modeling, run an update query to the basket item table, then redirect to a response page.

    You may have to add some additional logic if you are using a basket combined pricing module.

    The other problem I had was multiplying a variable by itself, example: var1 = var1 * 1.5.

    It only took an hour to complete, after thinking about it for 7 hours ;)

    If you are not very familiar with MIVA actions and DB you should contact a developer like Kent.

    But with Miva, anything is possible.

    Wow...sounds very creative on your part....nice work.

    If I'm reading it correctly though it means that the customer doesn't know the attribute price on the product page? If that's the case then this method wouldn't work....we need to show the customers before they make the choice what the cost is.

    I'm a little shocked that Miva doesn't allow for this. Sad when an awful cart like Zen Cart does something a top of the line cart like Miva can't do.

    I might have to just manually set attribute pricing.

    -Kevin
    Web Design and Development, Internet Marketing
    Lancer Media, Inc.

  6. #6
    Join Date
    Aug 2006
    Location
    Gap, PA
    Posts
    572

    Default Re: Possible to have attribute price be dynamic?

    You can create a display variable that mirrors the postaction. Add the markup percentage in the attribute options cost field, then:

    Code:
    <mvt:item name="ry_toolbelt" param="assign|g.markup|l.all_settings:option:cost" />
    <mvt:item name="ry_toolbelt" param="assign|g.displayprice|l.all_settings:option:price * g.markup" />
    <mvt:if expr="l.settings:option:price GT 0"><p class="option">Add &mvt:global:displayprice;</p></mvt>
    Miva already does what your asking for as inventory variants, it just requires some initial set-up and maintenence that can be done with spreadsheet uploads. Or you can use the toolbelt to do it dynamically.

  7. #7
    Join Date
    Mar 2006
    Posts
    6,655

    Default Re: Possible to have attribute price be dynamic?

    Quote Originally Posted by lancermedia View Post
    Wow...sounds very creative on your part....nice work.

    If I'm reading it correctly though it means that the customer doesn't know the attribute price on the product page? If that's the case then this method wouldn't work....we need to show the customers before they make the choice what the cost is.

    I'm a little shocked that Miva doesn't allow for this. Sad when an awful cart like Zen Cart does something a top of the line cart like Miva can't do.

    I might have to just manually set attribute pricing.

    -Kevin
    Perhaps the Zen cart wouldn't be as "sad" if they spent more time developing fundamental functionality and expandability instead of including a feature that 1/10th of 1 percent *might* need. <G>.

  8. #8
    Join Date
    Nov 2008
    Posts
    164

    Default Re: Possible to have attribute price be dynamic?

    Quote Originally Posted by Bruce - PhosphorMedia View Post
    Perhaps the Zen cart wouldn't be as "sad" if they spent more time developing fundamental functionality and expandability instead of including a feature that 1/10th of 1 percent *might* need. <G>.
    Zen has plenty of issues. I think in this case it's a basic bit of functionality that they decided to include that to me....makes sense.

    Another thing I was shocked at in Miva is that they don't allow you to include next to the attribute what the cost is. If I have a simple set of radio buttons where Option one is $10 dollars and Option two is $15....by default Miva doesn't display the price. I had to modify the PROD Attribute Template to show those prices.

    -Kevin
    Web Design and Development, Internet Marketing
    Lancer Media, Inc.

  9. #9
    Join Date
    Mar 2006
    Posts
    6,655

    Default Re: Possible to have attribute price be dynamic?

    Kevin,

    Not to be belligerent, but I've probably heard this request maybe four time in over 15 years of working with Merchant based clients...its not that common.

    As for the Price not showing by default: you can see, how its simple enough to add it, and again, 90% of the time in my experience, the attribute/option does not have a price associated with it.

    Its a different philosophy of approach (though that too seems to be changing a bit) where Out of Box its basic, but extremely flexible. That makes it easier to get the basics done fast, while not getting in the way of whatever it is you want to achieve.

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •