Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Add multiple products to cart

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #41  
Old 01-23-2006, 12:26 PM
 
pwd88 pwd88 is offline
 

Advanced Member
  
Join Date: Dec 2004
Posts: 80
 

Default

I implemented the code on the first page which funkydunk posted, it works great except it always redirects user to the cart page after clicking add to cart, I want it stay at the same page after adding, I just could not modify the code to make it happen, I think it is in part of the code in add_multiple.php
Code:
# # Redirect # /* if($mode=="add" and $productid) { if($config["General"]["redirect_to_cart"]=="Y") func_header_location("cart.php"); else func_header_location("home.php?cat=$cat&page=$page"); } */ func_header_location("cart.php"); x_session_save(); $smarty->display("customer/home.tpl"); ?>
I tried to uncomment the code, it does not work, Can any one advise how to modify the code to make it stay at the same page instead of redirecting user to the cart page
__________________
XCart 4.0.18 Gold
X-Giftregistry
Neon light
Fashion mosaic
Tabbed product menu
Reply With Quote
  #42  
Old 01-30-2006, 07:36 PM
 
matthew@wallstudios.com.a matthew@wallstudios.com.a is offline
 

Newbie
  
Join Date: Dec 2005
Posts: 5
 

Default

Any way to get this to work on the related_products page not the product list?

http://www2.apctechnology.com.au/cart/product.php?productid=1&cat=1&page=1

then click options.
__________________
lc 2.2.21
Reply With Quote
  #43  
Old 02-27-2006, 07:00 AM
 
skipmartin skipmartin is offline
 

Advanced Member
  
Join Date: Oct 2003
Posts: 30
 

Default 4.0.x

I've gotten this mod to work on a 4.0.17 shopping cart. I will not post my code because I hacked it severely and did not include any of the javascript checking for product options, however if someone is in need I'll be happy to assist them in getting this mod to work on their cart. Somehwere along the line in x-cart, there was major modification on how product options are stored in the datbase, so for the 4.0.x carts funkydunk's mod doesn't work as posted earlier.

If you need help with getting this working on 4.0.x drop me an email.

Cheers,
Andy
__________________
Andy Melichar, Tech Director - REBEL INTERACTIVE -
andy@rebel-interactive.com - X-Cart version 4.1.3
Reply With Quote
  #44  
Old 07-09-2006, 05:56 AM
 
MallRomania MallRomania is offline
 

Senior Member
  
Join Date: Apr 2006
Posts: 109
 

Default

Hello

Can somebody tell me how to NOT display quantity field if some of listed products have options? Everything it's ok on home page (i use recommend instead of features which include customer/main/products.tpl), the quantity field it's not visible if product have options but when i go to categories no matter if product have or not options, the quantity field is displayed.

The code is below:

{if ($active_modules.Product_Options ne "" and $products[product].product_options )}
{$lng.lbl.product_with_options} --------> text to be displayed for each product who have details
{else}
<input type="text" size="4" maxlength="10" name="amount[{$products[product].productid}]" value="0">
{/if}



Thanks for help
__________________
Mircea Teleleu
Shopedia.ro-la cumparaturi
www.shopedia.ro
______________________
x-cart gold 4.1.6
Linux
Reply With Quote
  #45  
Old 07-13-2006, 08:42 AM
 
seth@lowel.com seth@lowel.com is offline
 

Member
  
Join Date: Dec 2005
Posts: 10
 

Default

Hello All,

Love the mod...took some tinkering but i got it to work on 4.0.18.
I was stuck for a while, nothing would get entered into the cart, it would always say empty after the redirect, so it was going through the add_multiple.php page.

I felt it was something with the products_t.tpl. I didnt do any modifications to the file. So i just removed the

{include file="customer/main/products_t.tpl" products=$products}

from the products.tpl
And Voila it started working.

So my questions are:
What does/did the products_t.tpl do?
It seems to be working fine, what issues will arise if any, by not using the products_t.tpl?

Thanks All
-Seth
__________________
4.0.18
Reply With Quote
  #46  
Old 07-13-2006, 09:10 AM
 
seth@lowel.com seth@lowel.com is offline
 

Member
  
Join Date: Dec 2005
Posts: 10
 

Default ADD ALL above products list

A feature I would like to incorporate is having the "ADD ALL TO CART" button appear above the products list as well as below it.

if i just put the code at the top as well, it puts one above every product it loops through.
I tried putting it in the subcatagories.tpl above the include for the products.tpl, but it doesnt pass to the cart, just refreshes the page.

Any ideas?

GOT IT THANK YOU ANYWAY


-seth
__________________
4.0.18
Reply With Quote
  #47  
Old 07-13-2006, 09:33 AM
 
MallRomania MallRomania is offline
 

Senior Member
  
Join Date: Apr 2006
Posts: 109
 

Default

I think there will be no problems, i use old products_t.tpl and a new products.tpl based on this modifications and everything it's ok except my problem listed above your post.

Could you please tell me if it's ok for you when access category area? I mean, products with options should not have quantity input field and products without options have this field? In my case, except home page, when i access any category, all products have quantity field no matter if they have or not options

Thank you
__________________
Mircea Teleleu
Shopedia.ro-la cumparaturi
www.shopedia.ro
______________________
x-cart gold 4.1.6
Linux
Reply With Quote
  #48  
Old 07-21-2006, 08:46 AM
 
seth@lowel.com seth@lowel.com is offline
 

Member
  
Join Date: Dec 2005
Posts: 10
 

Default

Hope someone still reads this thread. If you saw above i implemented the add all to cart, i am using 4.0.18.
I also added an add to cart button above the products list. I was so happy with the mod, till i i checked in IE. Doesnt add to the cart, and redirects to homepage.

In Firefox works perfectly redirect to cart showing all the additions.

Any ideas anyone


-
__________________
4.0.18
Reply With Quote
  #49  
Old 07-21-2006, 09:10 AM
 
MallRomania MallRomania is offline
 

Senior Member
  
Join Date: Apr 2006
Posts: 109
 

Default

This is my customer/main/products.tpl page. I also use add_multiple.php original posted bu funkydunk in first page and i have "Display only featured products list in multicolumn format" ticked in Appearance, because i didn't make any modifications to products_t.tpl. Till now, except problems listed above everything work fine.

Code:
{* $Id: products.tpl,v 1.45.2.17 2006/02/27 08:53:50 svowl Exp $ *} {if $active_modules.Feature_Comparison ne '' && $products && $printable ne 'Y'} {include file="modules/Feature_Comparison/compare_selected_button.tpl"} {include file="modules/Feature_Comparison/products_check_js.tpl"} {/if} {if $usertype eq "C" and $config.Appearance.products_per_row ne "" and $config.Appearance.products_per_row gt 0 and $config.Appearance.products_per_row lt 4 and ($featured eq "Y" or $config.Appearance.featured_only_multicolumn eq "N")} {include file="customer/main/products_t.tpl" products=$products} {else} {if $products} <form action="add_multiple.php" method ="post" name="orderform"> <table border="0" width="100%" cellpadding="2" cellspacing="0"> <tr > <td colspan="5" valign="top" align="right">{if $js_enabled} {include file="buttons/button.tpl" button_title="Cumpara produsele" style="button" href="javascript: document.orderform.submit()"} {else} {include file="submit_wo_js.tpl" value="Cumpara produsele"} {/if} </td> </tr> <tr bgcolor="#da1821"> <td width="99" valign="top" class="headerrow style1"><font color="#FFFFFF">Imagine</font></td> <td width="370" align="left" valign="top" class="headerrow style1"><div align="center"><font color="#FFFFFF">Produs</font></div></td> <td width="302" align="right" valign="top" class="headerrow"><div align="center"><font color="#FFFFFF">Pret</font></div></td> <td width="86" align="center" valign="top" class="headerrow style1"><font color="#FFFFFF">Detalii</font></td> <td width="146" align="center" valign="top" class="headerrow style1"><font color="#FFFFFF">Cantitate</font></td> </tr> {section name=product loop=$products} {counter assign="row"} <tr> <td valign="top" class="listrow"> {if $active_modules.Special_Offers ne "" and $products[product].have_offers} {include file="modules/Special_Offers/customer/product_offer_thumb.tpl" product=$products[product]} {$lng.lbl_see_details} {else} <A href="product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}{if $featured eq 'Y'}&featured{/if}">{include file="product_thumbnail.tpl" productid=$products[product].productid image_x=$config.Appearance.thumbnail_width product=$products[product].product tmbn_url=$products[product].tmbn_url} {$lng.lbl_see_details}</A> {/if} {if $active_modules.Feature_Comparison ne '' && $products[product].fclassid > 0 && $printable ne 'Y'} {include file="modules/Feature_Comparison/compare_checkbox.tpl" id=$products[product].productid} {/if} </td> <td align="left" valign="top" class="listrow"><FONT class="ProductTitle">{$products[product].product}</FONT> {if $products[product].min_amount gt 1} <FONT class=small>({$lng.txt_need_min_amount} {$products[product].min_amount} {$lng.lbl_items})</FONT>{/if} </td> <td valign="top" width="302" class="listrow" nowrap align="right">{if $products[product].product_type eq "C"} {include file="buttons/details.tpl" href="product.php?productid=`$products[product].productid`&cat=`$cat`&page=`$navigation_page`"} {else} {if $active_modules.Subscriptions ne "" and ($products[product].catalogprice gt 0 or $products[product].sub_priceplan gt 0)} {include file="modules/Subscriptions/subscription_info_inlist.tpl"} {else} {if $products[product].taxed_price ne 0} {if $products[product].list_price gt 0 and $products[product].taxed_price lt $products[product].list_price} {math equation="100-(price/lprice)*100" price=$products[product].taxed_price lprice=$products[product].list_price format="%3.0f" assign=discount} {if $discount gt 0} <FONT class="MarketPrice"> {$lng.lbl_market_price} : <S> {include file="currency.tpl" value=$products[product].list_price} </S></FONT> {/if} {/if} {if $active_modules.Special_Offers ne "" and $products[product].use_special_price ne ""} <S> {/if} <FONT class="ProductPrice"> {$lng.lbl_our_price} : {include file="currency.tpl" value=$products[product].taxed_price} </FONT><FONT class="MarketPrice"> {include file="customer/main/alter_currency_value.tpl" alter_currency_value=$products[product].taxed_price} </FONT> {if $discount gt 0} {if $config.General.alter_currency_symbol ne ""} , {/if} {$lng.lbl_save_price} {$discount} % {/if} {if $active_modules.Special_Offers ne "" and $products[product].use_special_price ne ""} </S> {/if} {if $products[product].taxes} <TABLE border="0"> <TR> <TD>[img]{$ImagesDir}/spacer.gif[/img]</TD> <TD>{include file="customer/main/taxed_price.tpl" taxes=$products[product].taxes}</TD> </TR> </TABLE> {/if} {if $active_modules.Special_Offers ne "" and $products[product].use_special_price ne ""} {include file="modules/Special_Offers/customer/product_special_price.tpl" product=$products[product]} {/if} {else} <FONT class="ProductPrice"> {$lng.lbl_enter_your_price} </FONT> {/if} {/if} {/if}</td> <td valign="top" width="86" class="listrow" align="center"><a href=product.php?productid={$products[product].productid}>[img]{$ImagesDir}/info.gif[/img]</a></td> <td valign="top" width="146" class="listrow" align="center"> {if ($active_modules.Product_Options ne "" and $products[product].product_options and ($categorie eq "" or $products[product].product_options))} {$lng.lbl_product_with_options} {else} <input type="text" size="4" maxlength="10" name="amount[{$products[product].productid}]" value="0"> {/if} </td> </tr> <tr> <td colspan="5" valign="top" class="listrow"><hr color="#336699"></td> </tr> {/section} <tr> <td valign="top" colspan="5" align="right"> {if $js_enabled} {include file="buttons/button.tpl" button_title="Cumpara produsele" style="button" href="javascript: document.orderform.submit()"} {else} {include file="submit_wo_js.tpl" value="Cumpara produsele"} {/if} </td> </tr> </table> </form> {if $active_modules.Feature_Comparison ne '' && $products && $printable ne 'Y'} {include file="modules/Feature_Comparison/compare_selected_button.tpl"} {/if} {else} {$lng.txt_no_products_found} {/if} {/if}
__________________
Mircea Teleleu
Shopedia.ro-la cumparaturi
www.shopedia.ro
______________________
x-cart gold 4.1.6
Linux
Reply With Quote
  #50  
Old 09-15-2006, 03:23 AM
 
Jiser Jiser is offline
 

Senior Member
  
Join Date: Oct 2004
Posts: 118
 

Default Re: Add multiple products to cart

Hmm, adding multiple products are working fine. But product options are a problem:

<form action="add_multiple.php" method ="post" name="orderform">
<input type='text' size='4' maxlength='10' name='amount[5722]' value='1'><input type='text' size='4' maxlength='10' name='product_options[144966]' value='359633'></form>

Does any see a flaw about this one?
__________________
x-cart 4.05
Linux CENTOS
APACHE
Heavily customized
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:35 PM.

   

 
X-Cart forums © 2001-2020