![]() |
Add multiple products to cart
As it is my birthday tomorrow :) (cakes appreciated)
Here is a little mod that allows you to run the product listing page as an order form where the visitor can add in amounts for several products at a time and have them all added to the cart simultaeneously. First of all create a new php script in customer: add_multiple.php Code:
<?php Then create two language fields: err_minimum_amount err_minimum_amount_txt These will be shown at the top of the error page that is shown if the user does not order enough of something as follows: Then create a new template in skin1/main/minimum_amount.tpl : Code:
{* minimum_amount.tpl - funkydunk 2004 *} Then amend skin1/common_templates.tpl by inserting: Code:
{* new funkydunk *} before the final {else} Then amend the products.tpl and products_t.tpl as follows: (this is the code for products.tpl without images but you can get the idea from this :) Code:
{* $Id: products.tpl,v 1.36 2003/11/11 14:02:37 svowl Exp $ amended by funkydunk 2004 *} There are a few style sheets references in there that aren't standard but you should be able to get it working. PLEASE NOTE THAT YOU SHOULD BACKUP BEFORE DOING ANY MODS FROM THE FORUM. This was built for version 3.5.x gold but should work on Pro and may even work on 3.4 shops. Have fun :wink: |
Thats really cool :) I wonder if I can find use for this somewhere!
But you know, on your birthday you aren't supposed to work :) or even the day before for that matter! Have a great birthday \:D/ |
day before is fine - the day after is the problem 8) :-({|=
|
:lol:
I think I would have to agree with you there. |
Funkydunk, happy b-day, this code work with product options? :)
|
it wont display the amount box if there are any if that is what you mean
|
Good Code! Happy B-Day Funky! What About Cake on B-Day?
|
Happy Birthday Mate,
21 today eh :wink: Make sure you have a day off :idea: |
day off :?
moving to new offices today :) |
Quote:
|
HAPPY BIRTHDAY TO YOU! http://www.pixelitas.com/forum/images/smiles/beerchug.gif
Heh... I had to bring in one of the smilies from my forum :) |
Congrats FD. Nice code... :D
|
I though birthday boy suppose get us a Cake :oops:
also anyone tried this Code? Like to see in action. |
Thanks for the coding ... any one fancy a seek ... click on the link in my signature.
|
Carlisle Glass looks great. Super nice site. I love this multi-add to cart feature.
:D |
Great mod, funkydunk. With a little bit of modification, it fit a project I was working on perfectly. Thanks.
|
popup thumbnail
Thanks funkydunk I was about to add this feature to a site I was working on, you saved me a bit of time.
I have taken your code and added a few other bits like adding a stripe to the list to make it easier to read in large product list and I have also added a bit of javascript to popup the thumbnail of the product if you put your mouse over the info image. I am sure my code can be improved but I thought that I would post my mods here since Funkydunk was kind enough to share the original code. This was the modification I made to the products.tpl template :- At the top I added the following javascript: Code:
{* $Id: products.tpl,v 1.36 2003/11/11 14:02:37 svowl Exp $ amended by funkydunk 2004 *} To get the stripe add the code on line three of the following: Code:
{section name=product loop=$products} Then to open the thumbnail image on mouse over change the line Code:
<td valign="top" width="80" class="listrow" align="center"><a href=product.php?productid={$products[product].productid}>[img]{$ImagesDir}/info.gif[/img]</td> As you might of noticed from the code above this works with the thumbnail images outside of the database and with the images named after the productcode. Unfortunately I haven't got the time just now to make this more generic as I have other modification I need to make for the site I am working on but hopefully this might come in useful for somebody. |
hi,
i couldn't get this to work on 3.4.14, anyone else have any luck? Also, instead of have them choose the quanities and clicking on submit, is it possible to include a checkbox and then have them click on submit? |
you could have a dropdown box which only has 0 and 1 in it ... so instead of clicking a checkbox, you should change the dropdown box from 0 to 1.
|
it looks like the major function behind this mod is:
Code:
if ($amount) { What would I have have to sub in in order for it to be able to add multiple wishlist items? Thanks |
error on mod
hi, forgive me, i'm still kinda new at this:
I tried to follow you guidelines: created the PHP file, created the lang files as errors fields, amended the TPL and created skin1/main/minimum_amount.tpl, amended customer/main/products.tpl (coudn't understand how to modity products_t.tpl, so I left it as it was) and I can see how the product list page now shows a different kind of list with the qty boxes, but once I click on "add all to cart" I get this message: Quote:
thanks for this useful mod, it really makes shopping much quicker for those customers who know what they want. If only I could get it to work... matt |
i installed this mod on 3.5.10 gold and am getting the following error:
Parse error: parse error, unexpected T_STRING in add_multiple.php on line 35 any ideas on how to fix this? thanks, blue |
This would normally mean that a ; has been missed from the end of line 35. PHP is pretty good for telling you where the problem is.
|
How do you create a php file
I'd love to try this.
but how do i begin creating a php file. I am a newbie, but with a bit of help, i can get started. Thanks |
Just copy the code to notepad or whatever text editor you use then save it as: add_multiple.php
|
Hi Funky
I could really do with this working with a 4.02 site. Do you think it would without too much trouble? |
I believe I copied the instructions to the letter but when i open up the site it is blank. Any ideas?
|
?????????
"Then amend the products.tpl and products_t.tpl as follows:
(this is the code for products.tpl without images but you can get the idea from this" I dont get it do we replace it with that code below or just add it into it im so lost please help me. also i am confused about the language files are they .tpl or what sorry im a noobie :D [/code] |
Re: ?????????
Quote:
No problem that you are a newbie, but please take the time to read the forum rules and stickies. You should have your version # in your signature. It is a guessing game trying to help you otherwise and many people will ignore your post. |
Sorry about that, will you PM me a breakdown of what to do or actually do it for me please i love this mod and it would be very beneficial to me thanks.
|
Re: Add multiple products to cart
hi,
Do you mean the mini cart can show the number of product and the details of product thanks XCART 4.0.9 |
HELP!
Will some please help me set this up i keep getting so many errors and i am getting mad. lol Thanks ahead of time
|
Re: Add multiple products to cart
Is it working in xcart 4.0.9
Thanks in advance for reply |
I tried add the code to my related product tpl.
The only thing found is the submit button does not work. I changed code from: Code:
{if $js_enabled} to Code : Code:
{if $js_enabled} Now the submit is working. Looks like the original submit code can not pass the href to the button.tpl My X-Cart version is 4.0.9, I did it in "related_products.tpl" and has some other changes to "related_products.tpl ". So the customer can fill the qty for each related product and add them to cart by one click. |
Has anyone been able to get this mod to work in 4.x and has an example? I can get it to show up in the products_t.tpl, but my price and product options don't show up.
If anyone can see what needs to be changed or configured to get this to work for 4.0.11, I would be grateful! Also, if anyone needs this mod done, we could always split the $150 wanted to have it coded??? - Mike Here's my amended add_multiple.php: Code:
<?php Code:
{if $products} Thanks, - Mike |
Hi Mike - I would split the cost of doing this with you - who is going to do it?
Need it to be able to allow user to select options and qty on multiple products, and add to cart with one click. Lemme know - PM if you're interested - let's get it started! Instinctual Colorado X-Cart Versions 3.5.x - 4.0.x |
I just PM'd you ...
- Mike |
Hey I'm interested too!
I currently have 4.0.6, but will soon upgrade to 4.0.13. Please let me know how I can get in on this. |
I am interested too
It would be nice to offer a one click "add to cart" button
|
If you PM me, I can show you a link where we have implemented a multiple product orderding page. It offers an "Add all to Cart" from the many options.
- Mike |
All times are GMT -8. The time now is 04:09 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.