PDA

View Full Version : Min/Max qty - over series of items?


mikehaas
07-06-06, 02:12 AM
I need to define a "12 Pack" object that will display a list of
products.
- Each listed product can permit from 0-12 Qty
- I need to limit total Qty of all items to minimum AND maximum of 12
(any assortment of listed products)

For example...

Fruit 12 Packs: (Choose total of 12 items)

1. Peach Qty: 0
2. Cherry Qty: 6
3. Orange Qty: 6
...is OK

1. Peach Qty: 1
2. Cherry Qty: 5
3. Orange Qty: 6
...is OK

1. Peach Qty: 1
2. Cherry Qty: 6
3. Orange Qty: 6
...is not OK

...etc.

Geez, the things I get myself into. HELP! I've already asked EMPORIUM PLUS about their 'Minimum and Maximum Quantity'. Nope.

Mike

dotCOM_host
07-06-06, 02:24 AM
Check out the "Kit Maker" module from Emporium Plus. That may just do what you need... Not sure if it will allow you to force the min/max 12 item part, but it should let you create one product from a selection of three different things.

Or, with a bit of Javascript you should be able to add up the product counts on the product page and see if the total is 12, if not, display an error, and do not allow to use the Add To Basket or Buy Now buttons unless the total is 12.

mikehaas
07-06-06, 02:41 AM
Check out the "Kit Maker" module from Emporium Plus. That may just do what you need... Not sure if it will allow you to force the min/max 12 item part, but it should let you create one product from a selection of three different things.

Or, with a bit of Javascript you should be able to add up the product counts on the product page and see if the total is 12, if not, display an error, and do not allow to use the Add To Basket or Buy Now buttons unless the total is 12.
Sound like great suggestions, especially the second.

I sent Emporium Plus my query, just like above, and asked if their 'Minimum & Maximum' module would allow it. if not, I asked if they could suggest another solution. The reply was quick and curt but not much help - "It will NOT do that. I don't know of a module to do it." But it WAS very prompt. :-)

Thanks! If I go the javascript route, does Miva/OpenUI give me that much control over the generated html or do you mean I should create my own html page for that part of the store?

Sorry if my questions are dumb - I'm a newbie at Miva. This forum has been a lifesaver! if anyone else has any ideas, have no doubt about how much they will be appreciated.

Mike

dotCOM_host
07-06-06, 02:47 AM
You will most likely need to create your own custom template (easy enough if you use Viking Coders' Product Page Templates). Or, you could have the Javascript code disable the "Add To Basket" and "Buy Now" buttons when you load the page, keep track of the number of products selected, and if the total adds up to 12, activate the basket buttons. If the total does not add up to 12 and one clicks on the disabled buttons, you can even have a pop-up message alerting customer about an invalid selection...

If you are familiar with Javascript - that should give you enough info. If you are not familiar with Javascript and would like someone to write this code for you - contact me directly and I'll have one of our in-house developers write this for you for a nominal fee.

wcw
07-06-06, 03:24 AM
> The reply was quick and curt but not much help - "It will NOT do that. I don't know of a module to do it."

And I also told you it could probably be done with javascript. A straightforward question generally gets a straightforward answer. Either it will or it won't. There is either a module or there isn't. You are correct, I am a man of few words. Probably a result of 25 years of meeting schedules and developing efficient systems.

mikehaas
07-06-06, 03:39 AM
> The reply was quick and curt but not much help - "It will NOT do that. I don't know of a module to do it."

And I also told you it could probably be done with javascript. A straightforward question generally gets a straightforward answer. Either it will or it won't. There is either a module or there isn't. You are correct, I am a man of few words. Probably a result of 25 years of meeting schedules and developing efficient systems.

My apologies if I offended, there was no intention to do so. Your promptness and directness was a benefit - it allowed me to quickly go off and continue to search for solutions.

And, in response to a followup question on my part (inquiring about licensing your code which is also not possible), you did note javascript as a possible solution - thank you for that - it was the suggestion I requested.

If you preceive that I have in some way misrepresented your response to my initial query, again, I can only apologize. I don't think I did - I believe I quoted it EXACTLY (no emphasis was added by me) and in it's entirity - but in any event, you certainly did nothing wrong.

Mike

mikehaas
07-06-06, 04:11 AM
I wonder if this might be a viable method:

What if I completely did a selection screen in javascript (or whatever language), then, when all was right with the world as far as selections, I formulated a POST to the same place that the Miva-generated page goes to?

Of course, I would have to convert the selections and use the same POST elements that the normal Miva screen would use - spoofing the Miva product pages.

Anyone see any problems with this approach? (And thanks again, everyone.)

Mike

dotCOM_host
07-06-06, 04:16 AM
Definitely doable, but will likely require more coding than using stock Merchant pages. You can easily add just the code you need within your product pages with minimal changes to the other features. As long as the buttons in the store are named, you can reference them from your Javascript already, which means you can keep the form "as is" and use stock Merchant functionality to POST all elements - without reinventing the wheel and rewriting the code. You can still do all the pop-up warnings about invalid total counts, you can disable or gray out the Add To Basket buttons, etc. I think that's a much simpler approach than writing your own selection screen, as you'd then also need to learn how to pull products, attributes, etc, from your databases, just to get the product page to display, never mind the functionality you then need to add on top of that.

mikehaas
07-06-06, 09:35 PM
Hmm... even if I trudge out the javascript, I still have problems.

My client wants to offer 'packs' because the products are not to be sold in less than qty of 12 (not enough profit in fewer quantities). They can be sold in any combination, though.

I'm going to run into more trouble in the shopping cart. Even if I figure out a way to get the customer to select 12 items and then submit a list of those items to the Miva cart, the customer still must be prevented in the cart from dropping a grouped item off without having to going back and replace it.

Grouping items like this doesn't seem to be that strange an operation - I've seen the equivalent done in many retail stores. What about setups where one product REQUIRES another purchase? Can the shopping cart be configured for this kind of thing?

Sorry to ask for all this help, but I had no idea this would be so foreign a concept for Miva.

Mike

dotCOM_host
07-06-06, 09:57 PM
It's not a foreign concept to MIVA (I think you actually meant MIVA Merchant - the shopping cart, not the company MIVA?), as I don't know of any other off-the-shelf shopping carts that have this type of functionality. As you have pointed out, something like this requires a lot more logic built into the store not only on product pages, but also on basket contents and checkout pages to constantly validate the selections made by your customers. It's easy to handle in retail stores as people can keep track of that and remember these little details as they ring a sale through, but for computers - you have to build the logic into the software, in every step of the process, in order to work. Can it be done? Sure. Many very high-end online stores have such logic built into them, but don't expect a similar level of functionality from a an off-the-shelf shopping cart package that costs you a few dollars a month to host. I can show you shopping cart systems that cost upwards of $10K/month yet they still require fair amount of customization and programming to include all these unusual requests. MIVA Merchant is a simple, straightforward shopping cart, but customizable through the means of adding modules to accomplish just about anything you may need. Contact a developer and have them write a module for you for what you need - it's still going to be far, far less expensive than any other shopping cart I'm aware of that would still require extra coding anyway (as I said, I've never seen a shopping cart which, out of the box, would have this type of functionality).

mikehaas
07-07-06, 05:11 PM
...I don't know of any other off-the-shelf shopping carts that have this type of functionality...

Granted. But I'm not speaking of off-the-shelf functionality - I'm a programmer for 29 years now a web professional for about 10, and I'm willing to add what I need. I'm a little surprised this functionality isn't available from a 3rd party. By "foreign", I meant no provision for - no hooks (other than javascript - not exactly a "hook").

It's my first experience with Miva and my client's too - I guess I'm a bit discouraged as this is proving to be a major pain. From a sales/transaction point of view, grouping of products is just not that big a deal and I'm a bit surprised. Seems Merchant could support this easily with another product field and a bit of programming. It already has catagories and sub-categories, but they lose their meaning before the shopping cart stage. That's a shame, because it's EXACTLY the functionality I need carried through. A bit to declare "enforce this category as a 'sales group'" or somesuch, don't know, I'm the beginner here.

Ok, rant off. Wishing doesn't make it so. No one is going to rewrite Merchant for this newbie.

So if the forum isn't mad at me for wanting to rewrite Merchant, will you answer two more questions? (You have been EXTREMELY helpful in educating this newbie and I thank you profusely. I may even hire some of you and will definitely buy anyone's 3rd party module that helps here!)

1. I see how to add javascript to product pages - is there some means to extend the shopping cart?

2. If you think you can make this work, please call me. (Please contact the poster through Private messages for their contact information). (I guess that's not a question :-)

Discouraged but positive (positive about being discouraged :-),

Mike

dotCOM_host
07-07-06, 06:12 PM
Mike,

MivaCentral, althougn not necessarily selling "all" modules available for MIVA Merchant, is proof positive that things CAN be done within MIVA Merchant to add new functionality that merchants require. There are probably about 2000 modules available there - ie: 2000 things invented to expand what your shopping cart can do. If you don't see a module, chances are noone has found the need for it yet, or the development costs were in excess of the merchant's budget and the project never got off the ground. Module developers only write modules when either someone pays them to do so (for one-of-a-kind module) or when they know they can sell it to a number of people to cover their cost and development time. In your case, I don't see too many merchants asking for this type of functionality, so it doesn't seem to be a common request - hence no module available for it. If you are willing to pay a developer to write such module for you - I don't see a problem with someone being interested in such project, and I'm sure you will hear from a developer or two soon enough.

As far as your question #1... what do you mean by "is there some means to extend the shopping cart?"? I'm not sure how to read that in the context of adding Javascript to product pages...

Bruce - PhosphorMedia
07-07-06, 06:33 PM
There are "hooks" do to this, either at the API level (which isn't an appropriate topic in this forum...try the mivascript/empress one) or through OpenUI.

You could probably do what you want in OpenUI, using a specific Category as the "Group"...however, it might prove to be a bit slow. A better approach is to write an OpenUI extension module to do this. (We have done similar ones--they are not simple, simply because there are a lot of "doorways" that have to be watched: add to basket, update basket, remove from basket, etc.

(I'd love to offer to quote you on this, but we couldn't deliver it for a couple of weeks, if that works for you, send a message to info at phosphormedia.com)

mikehaas
07-07-06, 07:04 PM
...what do you mean by "is there some means to extend the shopping cart?"? I'm not sure how to read that in the context of adding Javascript to product pages...
I need to group products together not only on the pages where they are offered, but also in the shopping cart.

See, in the cart, we can't allow someone to delete a grouped item individually. That defeats the purpose of enforcing a certain number of items in the group on the product page.

Ok, so this can likely be done at the API level? My faith in Merchant is restored! (I'm sure a lot of folks were worried about my opinion:-)

And being a programmer, API work doesn't scare me. But the time-frame to learn a new API, etc does. So looks like more work-for-hire here.

Bruce, you can probably expect an email, and anyone else that thinks they can do this in a couple weeks or shorter (Bruce's time frame). My phone again is (please contact the poster through a Private Message for contact information) and the address is mikeh at muzzleenergy.com

And this is a GREAT forum! Guys like me would be totally lost without it (and you). Thanks, all, for helping me scope this task out. it's not insignificant, I've learned.

Mike

dotCOM_host
07-07-06, 07:27 PM
Mike,

Have you considered using attributes for these product types, rather than grouping individual products? If you use attributes, removing a 'product' from the cart would remove ALL parts that go with it, which means one less thing to worry about as people go through the checkout process and potentially make changes at that point. You can edit the number of 'products' on the basket page, but you can't change the attributes there.

Julie Wilber
07-07-06, 07:36 PM
Hi Mike and everyone else,

I removed Mike's personal information from the posts because anyone and their daughter can read this board. (They can't post until they join, but they can read it.)

If you can't get a hold of Mike, please send me a PM and I will give you his information.

I chose to remove his phone number from the posts because it's a safety issue. While we all hope that the world is full of good people, there are some bad apples around and a few of them can be found on the Internet.

Thanks!

mikehaas
07-07-06, 07:43 PM
Hi Mike and everyone else,

I removed Mike's personal information from the posts
No problem and thanks for watching out.

Mike

mikehaas
07-07-06, 08:09 PM
Mike,

Have you considered using attributes for these product types, rather than grouping individual products? If you use attributes, removing a 'product' from the cart would remove ALL parts that go with it, which means one less thing to worry about as people go through the checkout process and potentially make changes at that point. You can edit the number of 'products' on the basket page, but you can't change the attributes there.
Y'know, I remember thinking about attributes several weeks ago but not using them because there was no limit on the number of attributes that could be selected - back to square 1.

But on review, I remember them being otherwise ideal - each attribute (checkboxes) would actually represent a product and the actual "Merchant" product (the real one as far as Merchant is concerned) has a cost of 0, each "attribute" adding it's cost nicely to the total. The attribute unique code can surely be the real product code for the item the attribute represents. In fact, it virtually necessitates their use.

But I had not yet realized the difficulty with the cart I would encounter, and indeed, it looks like Mr. dotCOM_host has now identified a key behavior of attributes that looks like it solves THAT problem.

And with the earlier excellent suggestions of using javascript on the product page, here to limit the number of checkboxes checked... BY JOVE, I THINK A SOLUTION IS POSSIBLE! (gez, I sound like a guru already :-)

From the depths of despair (well, not really), you have raised a man high. if anyone sees the poison pill with this approach, feel free to knock me down again (and hard - I'm sure I deserve it for something :-)

But if you don't, I may shout the joys of Merchant (and this forum) forever!

Mike

dotCOM_host
07-07-06, 08:15 PM
Go ahead, shout! :-)

I think it's definitely doable, and if you take the attribute approach it will not only be a LOT easier to implement on the product selection page (javascript that keeps track of the total number of 'items' selected, while disabling the add-to-basket button if the number doesn't add up to multiples of 12), and this will also take care of the basket contents issue and someone wanting to change quantities of attributes there - which simply won't be possible. I think you got yourself a working solution here, and I think it's going to be easier than you originally anticipated ;-)

mikehaas
07-12-06, 10:57 AM
Well, as I start to actually build this (using 4.23) , I run into problems. Shame too, because attributes are really close to what I need.

1. Each product in the "12 pack" needs to be able to be selected multiple times (up to 12 of one item). But it seems Merchant will not include an attribute more than once (even if I modify the form to include the attribute again) - make sense for attributes, not for products-masquerading-as-attributes.

2. The total weight for the 12 items can vary based on the selections, so weight needs to be figured in like a real product for shipping cost calculation. While attributes can affect total cost, they cannot affect total weight.

Ok, looks like a bit of custom work is necessary. mr. Dot_com, will contact you in PM.

Mike