Jump to content

Attributes genereator - multiply instead of add?


Recommended Posts

I am trying to figure out a way to add product combinations.

 

One of the attributes, is the amount of copies of the product wanted, as customers usually order in bulks.

 

Can I multiply rather than add in the impact field? see http://snag.gy/i1PKy.jpg

 

As I have 40 combinations further down, the amount has to be calculated with multiplication, not addition. Is that possible?

 

Thanks for any help in advance,

 

K

 

 

 

 

 

Link to comment
Share on other sites

I will try and explain why quantity alone will not suffice.

 

For each book the customer has to choose attributes, and tese choices affect the price

 

- How many copies (quantity)

- How many pages 1 book has (less than 100, between 100 and 200, between 200 and 500, more than 500)

- Paper type, which increases the price PER COPY. As I do not know how many pages in advance,I have to multiply the cost of the paper with the amount of pages.

- Color or black and whiute, affects the the price per copy according to the amount of pages. Again I have to multiply the color/b&w price with the amount of pages.

- Hardback or softback (simple addition)

 

So price for the book(s) would be

 

quantity * ((pages * papertypecost * colorscost) + backtypecost)

 

Cheers, K

Link to comment
Share on other sites

In that case we have the same problem -- I have set up a store for my GF and she sells custom index tabs but since tabs often go into custom binders she also offers those and the printing of the guts so basically the same as your situation except binders instead of books.

 

I have a multi-step plan to solve his.

 

Current implementation

 

Client selects colour, b/w, or b.w economy as three separate products. Each product has a attribute called number of pages which is 25 to 500.

 

This works but is clunky -- having 475 choices for page number is stupid.

 

For your situation though this would work since you are not concerned about exact page count and treat 366 the same as 399.

 

So the way I would do yours is

 

Number of Pages -- options <100, 100-200, 200-500. 500+

Printing -- options colour and B/W

Stock -- options I don't know your stocks but lets just say 20lb, 24lb , 32lb, Recycled 

 

That gives you 4*2*4=32 combinations. You don't need multiplication because you can set the price for each combination individually. So you do the multiplication yourself and just put the price adjustment in relative to the default price.

 

If you had a lot of combinations (for example I was doing a product with 1600 yesterday) then you can use excel to set up the prices and import them into your store. For 32 combinations I would just do it manually but say you added 4 kinds of covers, 4 kinds of bindings, an option for shrink wrap then that 32 combinations would balloon to 1024 combinations so using excel is worth it as manually entering 1024 combinations would be an insane use of time.

 

Eventual implementation

 

My eventual goal is going to be to program it so that the store gets the page count from the PDF file. I know that is possible but I want to finish the stores first before I start getting too far into custom code. Once I get page count working my next version I hope to be able to detect the number of colour and number of b/w pages in the PDF. I've seen people asking for help on this so I know it is possible but from the help requests seems difficult.

 

 

 

If you need more detailed instructions on how to implement your prices using combinations and price adjustment let me know. Happy to write out step by step.

 

I actually considered doing it your way originally but then I decided customers would get put off if they had to pay the same for 201 pages as someone was paying for 249 pages. The individual page method though is really not great either. 

Edited by Naldinho (see edit history)
Link to comment
Share on other sites

Hi Naldinho

 

Thank you for your feedback. We have already tried the product combinations solution you suggested, and while it can indeed be done, by setting up all calculations in a spreadhseet in advance,

 

In the above example we have quantity * ((pages * papertypecost * colorscost) + backtypecost), which amounts to 4 x 6 x 4, which is 128 products with unique pricing.

 

it will quickly become too heavy to manage when have 40-50+ products. Some of them even have much great variety than the example above.

 

The worst part however, is that it offers very little perspective for the customer. Trying out the different combinations and evaluating what to buy, becomes nearly impossible, and setting up and editing tables in the product description per product also adds to the issue.

 

Currently we're hunting down a freelancer to take up the challenge, as we can see there are many shops out there with similar options. So instead of throwing a lot of money into design/developing a unqiue look and design, we'll opt for a theme, and then focus our initial expense on getting a module developed, as it is paramount to getting the shop up and running.

 

Regards, K

Link to comment
Share on other sites

The store I am setting up currently has 42 products eight have around 1500 combination and one has 2700 -- the rest are 70-600 combinations. I don't find it unmanageable. I use a spreadsheet to calculate the cost of production and my desired markup for that product this allows me to do whatever math I want and then just the price gets imported into the Prestashop combination sheet. Each product has their own spreadsheet. Once I save the csv I use a program to cut it down to 100 line files automatically-- some shared hosting has timeout issues for importing large files-- upload them to the server and import. 

 

For a custom code what you want should be pretty simple. Unless there is something I am misunderstanding I think your formula is incorrect -- I think it shouldn't it be (paper * pages) + (colour * pages) + backtypecost --- so rather than looking to multiply impact you are still looking to add but the amount you want to add is being multiplied by one attribute.

 

Assuming I'm correct this should be an easy modification

 

Step 1 use the value of Pages to set a variable that will be what the other attributes get multiplied by.

 

Step 2 use an if statement to decide if the variable gets multiplied or not. The if statement would be triggered by the attribute name and then you would use the same trigger on all multiplying attributes -- for example PaperMUL, ColorMUL, xxxxxMUL -- any attribute that ends in MUL the impact on price gets multiplied by the variable set in Step 1 before adding and those that don't just get added without modification.

 

PrestaShop allows you to get up two different names -- one is customer facing the other is only in the backoffice so you'd use the backoffice one as the trigger leaving the customer facing names unaffected.

 

Unfortunately my experience with PrestaShop is still pretty limited and I'm too busy to dig into this but anyone with PrestaShop experience should be able to give you the modifications you need fairly inexpensively. Some of the regular posters are pretty generous and if they see this topic they might just post the modifications you need to make.

 

This is really just a few lines of code so if you go with a freelancer take that into account when agreeing on a price. A while back I looked at hiring someone to do some freelance work that I ended up just doing myself in the end -- I got two people who gave me fair quotes ($150-300) and then a series of insanely high quotes $1000-1500+ for something I ended up doing myself in roughly 30 minutes. 

Edited by Naldinho (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...