Results 1 to 27 of 27

Thread: Too many variants?

  1. #1
    User
    Join Date
    12-07-10.
    Location
    Nijmegen, the Netherlands
    Posts
    36

    Default Too many variants?

    Hi,

    I am adding a new product to my isotope shop with a lot of product options.
    There are 9 options that are available at a price. The size (3-different sizes) and the type of damping (spring or air) are also possible but these have no extra price.

    Of course I do not have all those in stock, most are custom made or adapted at the time of order so I do want all of those options always available.
    But since all of the options come at an extra price I don't see any other way than creating variants for all of these options.
    If I take only the 9 options that add to the price I already have 512 different variants :? And ... I need to manually add up all the prices for these options myself whereas in my old (oscommerce) shop I was able to just specify the price with the option and have the system calculate the total price.

    The eshop I am now building is for a bike shop. They have about 40 different bikes with each 8-16 different options that add up to the price and alone from typing the price for each variant I will get blisters on my fingers :|

    Can anyone suggest a more sensible way of doing this. Adding over 40,000 products (variants) to my shop just because a customer can order a bike with different options is not the way to go forward (I think).

    Regards,

    Rob

  2. #2
    User
    Join Date
    06-29-09.
    Posts
    271

    Default Re: Too many variants?

    Rob, you could add a price field to the attribute type if you'd create a custom extension. Then with the calculatePrice hook you can add the price for it. But I think that would only work for select/checkbox/radio attributes? You'd need to assign a price for each option. (not sure if there is a widget in the dca that does this, so could be much extra work??) I like the idea and if I have some time I might look at it. (don't count on me though ops

    But I agree with Rob. Each product option that would make a change would in fact be a different product but for custom products where each option is possible (Cartesian product) a field defining the extra cost for the option would work as well. I'm now making a custom product to circumvent having to add thousands of products, but that is very custom and cannot be used for other purposes.

    Additionally an option that allows for easy price adding in the variant wizard would be great as well.

  3. #3
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Too many variants?

    Don't sweat it Vera, I liked that idea and just built it. It is a quick 1,5 hour piece of code, probably has some things in it that I did not think through well enough, but it seems to be able to so what Rob requests!

    Please let me know if you have any trouble with it. Also which versions you are using it with so I could expand the compatibility list.

    http://www.contao.org/extension-list/vi ... price.html

  4. #4
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Too many variants?

    Realized this morning that this will only work for admin defined attributes. I need to add something that also looks at user defined variables. And also do the javascript; this could get complicated. (edit: user defined now also supported, but it only updates after adding to cart..)

    Lots of bugs as well; I got my array keys and values in my setup mixed up. I'll fix it. (edit: fixed)

  5. #5
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Too many variants?

    Can someone tell me how to add price updating to the javascript? I've made the extension use both admin and user defined values. Now that price should update when people select options. Perhaps some ajax?

  6. #6
    User winanscreative's Avatar
    Join Date
    06-21-09.
    Location
    Massachusetts, United States
    Posts
    261

    Default Re: Too many variants?

    Wow... Nice job, Ruud! This is pretty slick (and useful!)

    You'll definitely need some ajax. Off the top of my head the way to do it would be tie into the generateAjax HOOK in IsotopeProduct to retrieve the price via AJAX and then update the price field. Check out how we use Andreas' ajax extension to do the AJAX updates for variants and you should be very close...

    EDIT: You may not even need to use the hook. Just call your JS the same way we do in isotope.js->IsotopeProduct class and then update the price only. Just make sure your JS is set to trigger on your options select's onchange event.

  7. #7
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Too many variants?

    Quote Originally Posted by winanscreative
    Wow... Nice job, Ruud! This is pretty slick (and useful!)

    You'll definitely need some ajax. Off the top of my head the way to do it would be tie into the generateAjax HOOK in IsotopeProduct to retrieve the price via AJAX and then update the price field. Check out how we use Andreas' ajax extension to do the AJAX updates for variants and you should be very close...

    EDIT: You may not even need to use the hook. Just call your JS the same way we do in isotope.js->IsotopeProduct class and then update the price only. Just make sure your JS is set to trigger on your options select's onchange event.
    Thanks Blair. I've got most of it working now (I'll upload it to the ER when it is done). But I'm very unhappy with the things I needed to do. Perhaps I got some things wrong!! For one thing the product does not load all options even though custom hooks might require certain options in their price calculation (mine for example). If the product would load all options I'd not need to use an extra hook because the original hook will read the same product for ajax and non-ajax. What I did to circumvent this is add an iso_generateAjaxProduct hook. This will add the missing options that my other hook finds important, then queries the price attribute. Finally I replace the price option html with the new data.

    What I need to do before publishing these changes is to add the onchange event. I need to work out which items to select for the onchange event. Going to look at that tonight.

    I've attached the code I have so far, but it won't work unless you edit IsotopeProduct (which is the part I will look at tonight)

  8. #8
    User winanscreative's Avatar
    Join Date
    06-21-09.
    Location
    Massachusetts, United States
    Posts
    261

    Default Re: Too many variants?

    Changing IsotopeProduct is not a big deal. Just create and register your own product type and extend IsotopeProduct with a new product class with your changes. The system was designed for that...

    I may take a peek at this today to see if I can help!

  9. #9
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Too many variants?

    I was able to get it all working, it is in the ER. It definitely needs some polishing. Hopefully you can advice a bit Blair?

    Making a custom product is something I've done on several occasions but that is not a good option for two reasons; I wanted it to work for any product type (though "most types" seems more realistic). And I changed the default dca option two include a price which is confusing for all other product types.

    ps, Rob, I hijacked your topic, does my extension help you at all?

  10. #10
    User winanscreative's Avatar
    Join Date
    06-21-09.
    Location
    Massachusetts, United States
    Posts
    261

    Default Re: Too many variants?

    I'll have to take a look. I remember that Magento had this as a default feature (simple options vs. variant options) so it might not be a bad idea to see if we could build it into the core.

  11. #11
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Too many variants?

    I've updated my extension so that it works (with Contao 2.10 and Isotope 1.3)

    It suddenly saved me tons of variants, but then costs some when fetching the price. I would have to measure which is better, I have no clue. Anybody?

  12. #12
    User
    Join Date
    12-07-10.
    Location
    Nijmegen, the Netherlands
    Posts
    36

    Default Re: Too many variants?

    Ruud,

    just installed the new 1.0.0 version on my new isotope shop and that works great!

    Regarding the cost when fetching the price ...
    I'm not too concerned about that. Using variants will also cost some ... For each selection of a different option value (a different variant) the database needs to be queried to get the new information. One would need to measure the total CPU and disk costs in order to define which is better.
    But in general I think that a smaller database will be faster to search and that is done for each product again - even the products that do not have options or variants.

    How difficult would it be to add the advanced pricing scheme to this?

    Rob

  13. #13
    New user
    Join Date
    07-25-11.
    Posts
    20

    Default Re: Too many variants?

    Hi,
    Ruud I'm having trouble with installing your extension. ER cannot find it, manual installation also fails (zip package downloaded, unpacked to contao folder, installation script started and nothing happens). What do I do wrong? Missed sth?
    Your extension would save me a lot of trouble so it's most needed one right now.
    I'm dealing on Contao 2.11.2 and Isotope 1.3.1..
    Pls help me on this

    Regards

  14. #14
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Too many variants?

    Quote Originally Posted by kylu123
    Ruud I'm having trouble with installing your extension. ER cannot find it, manual installation also fails (zip package downloaded, unpacked to contao folder, installation script started and nothing happens). What do I do wrong? Missed sth?
    You see two problems;
    • ER: the ER is ridiculously dumb. Even when you fill in the exact extension name it will not always find it. You can best install through the ER manager which has the option "install extension". There you can fill in the name and it will install perfectly fine.
      Today I was unable to even find Isotope itself in the ER, incompatible was checked. How about that, right...[/*:m:b2w7euny]
    • The second thing about installation comes down to this: there is no additional installation after copying files. No db update needed. Did you read the instructions on how to use?[/*:m:b2w7euny]

    To use (extension) add an attribute of the select type. The options field will have an extra field called price. You can use price as follows:
    So what you need to do is create the attribute that will change the price of the product. You should notice the options field got an extra column called price.

  15. #15
    New user
    Join Date
    07-25-11.
    Posts
    20

    Default Re: Too many variants?

    Thanks Ruud
    Works nice.
    I have only one more question - lets say I have two product attributes: size and weight.
    If I add for example '+5' to price field in size attribute the product overall price is calculated correct, but if I put +5 to price and '+6' in weight field, product price is calculated in a way that I cannot understand, wrong.
    So adding price to only one attribute works perfect, but adding anything to more than one attribute does something wrong with the product price.
    Am I missing sth? Pls let me know how and where the total price is being calculated.

    Best Regards

  16. #16
    New user
    Join Date
    07-25-11.
    Posts
    20

    Default Re: Too many variants?

    Ok, I see how it works
    The values are just presented according to its operator and by the order of attributes.
    When using only addition and substraction that doesnt matter but in case of multiplication (of which I am thinking) that is crucial.

    Regards

  17. #17
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Too many variants?

    Yes, a unfortunate effect of the way this has to work. If the two isotope attribute extensions I made together can't describe your products and prices then you must use variations. A lot more work, but they will allow everything else.

  18. #18
    New user
    Join Date
    07-25-11.
    Posts
    20

    Default Re: Too many variants?

    Thanks Ruud.
    One more question - in my case ordering process consists of two steps:
    1. Choosing product and its attributes
    2. Choosing quantities (created as attribute)

    After those two I would like to add some product to the cart.

    Right now after first step I'm being moved to order and products is being placed in the cart.

    Quantities is something that I would like to do also using attributes, because that solutions suits me best.

    For egzample: in first step i choose size color and material and in second step I would like to choose quantities like 1k, 2k, 3k, 10k, 20k or 50k (I'm selling labels). Price depends on ordering amount and that I could do fine using attribute "amount".

    Any idea how to seperate one attributes from the others in ordering process?

    Regards

  19. #19
    New user
    Join Date
    07-25-11.
    Posts
    20

    Default Re: Too many variants?

    ok, so maybe in another way. What I've done is: in the first step I just listed options using:
    <?php foreach( $this->options as $arrOption ): echo $arrOption['html']; endforeach; ?>
    and all active attributes displays nice.

    I've posted it to another page (not to the cart). Works ok.
    Now in that page I would like to refer to and display those options that are set inactive in BE (to be precise in Store configuration -> product type - > attributes and checkboxes). In my case it is QUANTITY.

    The question is how can I use those attributes which are set inactive without checking them in configuration ??

    Thanks in advance.

    BR

  20. #20
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Too many variants?

    Well, producttypes define what a product looks like. If you tell Isotope the product does not have an attribute called quantity then the product does not have quantity. You should look at you logic or explain why you need this.

    Another question I'm having is why you have a quantity attribute. Does that define a quantity of items within a single product? Like 42 chewing gums package, costs 1,25. A single package with 25 gums costs 0,95. Nr of chewing gums being quantity?

  21. #21
    New user
    Join Date
    07-25-11.
    Posts
    20

    Default Re: Too many variants?

    oh I see, so not checking the checkbox means that attribute is not created. So there is no way that I could use attribite without seting it active.

    And for the attribute quantity:
    I am using Your extension that helps me with pricing (each attribute changes product price). Quantities also changes price - if you buy more you will pay less, and for each quantity option there is different price factor.
    for egzample: quantity values and price:
    1 -> +100%
    2-> +90%
    5-> +80%
    10-> +70%
    20-> +50%

    Attribute "quantity" and your extension alows me to manage costs what ever I want. That's why I want to use it, because it gives me a freedom of setting these factors in BE.
    Can you advice me at that?

  22. #22
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Too many variants?

    I think you should be using advanced pricing or rules and coupons to create your pricing teirs. These systems are designed to add the functionality you need.

    You really should be creating your own topics for these questions.

  23. #23
    New user
    Join Date
    07-25-11.
    Posts
    20

    Default Re: Too many variants?

    Thanks.
    Few more things.
    Is it possible or how to obtain product price ($product['price']) before submitting to the cart? Before adding to the cart I would like to have price preview so that client could choose the best options.
    I would like to continue doing quantities as attribute options.
    All help very appreciated.
    BR.

  24. #24
    New user
    Join Date
    07-25-11.
    Posts
    20

    Default Re: Too many variants?

    Ruud ,Can You please advice me how to obtain product total price or just values of fields "price" from Your extension? I could calculate the total price by myself before submiting to the cart? That would help me a lot. Thanks in advance.

  25. #25
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Too many variants?

    obtaining a product price you do from a product, not my extension. please create seperate topics for seperate questions.

  26. #26
    New user
    Join Date
    07-25-11.
    Posts
    20

    Default Re: Too many variants?

    Ok, thanks.
    As for the new topics for my questions - shall I just copy all those to new topics or is there some feature that would help me move them to new ones?
    Best regards.

  27. #27
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Too many variants?

    Please post future issues on github: https://github.com/Ruudt/isotope-isotop ... bute_price

Bookmarks

Posting Permissions

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