Magento Forum

Page 2 of 2
Buy per multiple? 
 
haraldinho
Jr. Member
 
Total Posts:  24
Joined:  2009-09-25
 

Dear dd_gi,

I implemented the core modification and it works fine, but I can’t seem to find the exact location of

checkout/cart/item/default.phtml

In the directory of the Magento theme I use there is no such file in this location. To which directory does Magento defaults in such cases?

Another question: the core modification now holds for all websites within my Magento implementation, right? How can I restrict the mod to only a specific website?

You rock!

 
Magento Community Magento Community
Magento Community
Magento Community
 
haraldinho
Jr. Member
 
Total Posts:  24
Joined:  2009-09-25
 

on my system that is in app/design/frontend/default/default/template/checkout/cart/item/default.phtml

Damn, I hate to keep bugging you like this, but it seems like it doesn’t process the code. So I guess I have the wrong default.phtml, although I took the one you indicated. Can it be that the template I use processes the cart in a different file? Is there a way to check which phtml file has been processed when viewing the cart window?

The if statement would only evaluate true for a product if you populate that product with an entry in orderable_quanity attribute, is it that you have products with orderable_quantity that are assigned to different magento websites and you only want the drop down to show on one of the websites?

I could have known this… You write very clean code!

 
Magento Community Magento Community
Magento Community
Magento Community
 
haraldinho
Jr. Member
 
Total Posts:  24
Joined:  2009-09-25
 

Dear dd_gi,

I don’t know exactly how to thank you for your help. I’m amazed at your willingness to help me out, by your analytical sharpness about possible problems in the solution I was looking for and by your top-notch code…

My problem is completely solved. You’ve made me one happy man!

YOU ROCK!!!
gringringringringringringringringringringringringringringringringringringringringringringringringringringringringringringringringringringringringringringrin

 
Magento Community Magento Community
Magento Community
Magento Community
 
HyperBallad
Member
 
Avatar
Total Posts:  57
Joined:  2008-06-27
Montreal, QC
 

Wow, perfect for my store as well ! Thanks a lot dd_gi !

 
Magento Community Magento Community
Magento Community
Magento Community
 
louislgf
Jr. Member
 
Total Posts:  16
Joined:  2009-09-11
 

I apologize in advance for sidetracking from this topic, but my question has some relevance to dd_gi’s solution.

How do I make it compulsory for users to input a numerical value in the Quantity box and give a warning if it is not filled in/

Its giving me a big headache lol.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
haraldinho
Jr. Member
 
Total Posts:  24
Joined:  2009-09-25
 

Dear dd_gi,

Your solution works great most of the time, thanks for that. But we seem to experience strange errors which might be related to this solution. I’m not sure. What we see is the following:
* customers experience regularly, though not always, when they add a product to the cart, an additional item gets added. So in my case, if I select 6 from the dropdownbox en press ‘add to cart’, the cart returns the message that an illegal quantity has been added to the cart and that the next most amount has been selected. This yields 12 items in the cart.
* customers experience a lot of ‘cookies are not enabled’ errors when they navigate to and from the cart, even if they have ordered perfectly well in the past. Refreshing fixes it, but the message is ugly of course and is bad for the image of the site.

Do you have any clue what the cause might be of these two errors? Could they be caused by the cart modifications you suggested, and might they be fixed easily?

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
haraldinho
Jr. Member
 
Total Posts:  24
Joined:  2009-09-25
 

dd_gi, I don’t know which browser you are using, but it appears to happen with both FF3.5 and IE8. Just clicking around somewhat almost always gets me the error. The effect is one red line above the cart (the message that the amount is rounded to the next possible value) and two similar green lines with the message ‘product has been added to your cart’.

Although I cannot find a 100% working recipe, opening the site, ordering something, waiting for some time (10-20 minutes), then ordering again, seems to produce more errors.

Please try clicking through the site again using FF or IE, which should yield the fastest result. If that fails you could try the ‘recipe’.

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
haraldinho
Jr. Member
 
Total Posts:  24
Joined:  2009-09-25
 

Hi dd_gi,

Thanks for helping me out. The cookie problem has been solved: adding a domain and directory did the trick. The cart thing still is there. I am wondering why this is.

My further analysis:
it seems like in Chrome all goes as expected, in FF3.5 the problems happens regularly and in IE8 almost every time. In IE it happens with many people, in FF it seems to happen only with me so far.

It looks like Magento adds the chosen amount (i.e. 6 bottles) and then adds 1 more, in two separate actions, since the green bar in the cart view contains two identical messages “Product X has been added to your shopping cart”. This is not the result of a doubleclick. Just a single click.

It makes me think of a problem that was in Magento earlier with IE, where extra items were added to the cart also. See also: http://www.magentocommerce.com/boards/viewthread/28366/

I tried the solution there, but it didn’t solve the problem.

Did you try testing with IE? Did it work out fine for you?

 
Magento Community Magento Community
Magento Community
Magento Community
 
haraldinho
Jr. Member
 
Total Posts:  24
Joined:  2009-09-25
 

After these modifications, the number of times I got double orders was less, but still they were there. I have dived deeper into this problem with the double entries in the shopping cart. I could not abandon the solution, it is too beautiful and most of all, it should simply work. There seems to be no logical reason why it shouldn’t. So, I came across this thread: http://www.magentocommerce.com/bug-tracking/issue?issue=6147 and http://www.magentocommerce.com/boards/viewthread/28366/ which discusses an IE8 error that must have been fixed in the Magento release I use, but it seems exactly the same. I tried to implement the “; return false” solution, and… IT WORKS!!!

So the button code now is:

<button class="button" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>'<?php if($_product->getOrderableQuantity()): ?>+'qty/'+$('qty').value+'/'<?php endif; ?>);return false">

Strange enough this bug should be fixed in 1.3.2.3, but obviously in some cases it still pops up, though not always, but often in IE8, not so often in FF3.5 and never in Chrome.

Again, thank you very much for all your help!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
MrSmileyJr
Member
 
Total Posts:  43
Joined:  2009-10-19
 

I’m a little confused: first of all, I don’t see any posts by dd_gi. Also, the only code I see is in the last post by haraldinho.

Moving on:

1) anyone have any examples sites where this code works?

2) Can I limit this code to wholesale store view only, while retail would work as usual?

3) I remember reading that there is a way to make it automatically add the minimum to cart. So if 5 was added and you sell in packs of 6 - it will add 6 and display a “packs of 6 only” message. Add 9, it moves it to 12.....

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Cole Geissinger
Sr. Member
 
Avatar
Total Posts:  174
Joined:  2008-12-23
Northern California
 

ahhh! I have gone to 3 different posts. All having this dd_gi guy seeming to answer your questions. But his posts are gone...can anyone answer this??

 
Magento Community Magento Community
Magento Community
Magento Community
 
haraldinho
Jr. Member
 
Total Posts:  24
Joined:  2009-09-25
 

All,

dd_gi is the specialist here, I am just an extremely happy user of his solutions. For why his posts are gone, see this thread http://www.magentocommerce.com/boards/viewthread/65120/#t192177

Being dissappointed in Varien, dd_gi moved to this forum http://mageforums.com/ where he will gladly answer all you questions as he told me. Just contact him there.

Regards,

Haraldinho.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Cole Geissinger
Sr. Member
 
Avatar
Total Posts:  174
Joined:  2008-12-23
Northern California
 

thank you for pointing me the right direction!! Much appreciated!

 
Magento Community Magento Community
Magento Community
Magento Community
 
sean US
Member
 
Total Posts:  58
Joined:  2008-10-01
 
haraldinho - 17 November 2009 02:46 PM

All,

dd_gi is the specialist here, I am just an extremely happy user of his solutions. For why his posts are gone, see this thread http://www.magentocommerce.com/boards/viewthread/65120/#t192177

Being dissappointed in Varien, dd_gi moved to this forum http://mageforums.com/ where he will gladly answer all you questions as he told me. Just contact him there.

Regards,

Haraldinho.

Its really sad that this post got deleted. I really need this feature and I need it for several websites. I also went to “mageforums.com” but it does not explain how to do the changes in details. It only has some files and I am not sure where to replace the files. Does anyone remember what the steps where or how to work with the files that where supplied at mageforums.com ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Cole Geissinger
Sr. Member
 
Avatar
Total Posts:  174
Joined:  2008-12-23
Northern California
 

I’m not sure if this was the article you found, but this is what I used on a Magento installation a little while back. If you need more assistance let me know and I’ll see what I can do to help.

http://mageforums.com/viewtopic.php?f=4&t;=13&p;=76&hilit;=by+per+multiple#p76

- Cole

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 2