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

Remove Quantity on Details Page

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-07-2011, 07:29 PM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Remove Quantity on Details Page

I've got one product on the whole site that is used as a Deposit, it's a single item purchase, so I don't need customers selecting quantities.

I'd like to hide the Quantity and the Drop Down.

I'm pretty sure I need this: $product.productcode eq 'Deposit' But I don't know where to put it.

I've tried putting it on the product_details.tpl but I'm doing something wrong. I've been modifying the common_files version, because I'm using the 3-column template and there's not product_details.tpl in the 3-column folder.
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #2  
Old 04-08-2011, 02:31 PM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default Re: Remove Quantity on Details Page

If it's not there then it will use the one from common_files. Copy the file to the same place in 3-columns and edit it there.
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
  #3  
Old 04-09-2011, 09:14 AM
 
a333 a333 is offline
 

Member
  
Join Date: Jul 2010
Posts: 25
 

Default Re: Remove Quantity on Details Page

the quantity box code is in buy_now.tpl.

what i did was create a div class around the quantity box called "hidden" with the css code "visibility:hidden".

this will keep the quanitiy box there( which is necessary to add to cart) but hides it from view.

you can also add a margin-bottom: -30px within the "hidden" css if your worried about the empty space so that that "buy" button moves up the fill the gap.
__________________
xcart 4.4.3
Reply With Quote
  #4  
Old 04-09-2011, 11:49 AM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: Remove Quantity on Details Page

a333,

I removed the Buy Now feature from the site. I'm speaking specifically about the drop down on the product details page.

See my current example:
http://www.mikeinfinger.com/demos/xcart/Party-Deposit.html

The whole quantity section has bee removed with the exception of the 1, which I will probably use your "hidden" css to take care of that.

My next problem is after adding it to the cart, they can now change the quantity.

I've breifly looked into it, but I cannot figure out which tpl to modify to "hide" the option to increase the quantity, using my if/then statement I should be able to only hide it for the Party.

Here is a regular product with the quantity showing:
http://www.mikeinfinger.com/demos/xcart/Monster-Caramel-Chocolate-Apple-Cashew.html
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #5  
Old 04-19-2011, 04:48 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Remove Quantity on Details Page

The template can very depending on the skin, thus please try the "Webmaster mode". It should help locating the proper template.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #6  
Old 04-19-2011, 04:49 AM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: Remove Quantity on Details Page

Thanks Alex, my mod seems to be working well on my 3 Column template. Nice to see you posting
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #7  
Old 05-18-2011, 02:03 PM
  techker's Avatar 
techker techker is offline
 

Senior Member
  
Join Date: Feb 2009
Posts: 155
 

Default Re: Remove Quantity on Details Page

Quote:
Originally Posted by a333
the quantity box code is in buy_now.tpl.

what i did was create a div class around the quantity box called "hidden" with the css code "visibility:hidden".

this will keep the quanitiy box there( which is necessary to add to cart) but hides it from view.

you can also add a margin-bottom: -30px within the "hidden" css if your worried about the empty space so that that "buy" button moves up the fill the gap.

can you show your code?
__________________
X-Cart version 4.4.3
Reply With Quote
  #8  
Old 11-14-2011, 11:18 AM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: Remove Quantity on Details Page

Bringing back an old thread of mine with the code.

Modify this file: skin/common_files/customer/main/product_details.tpl

The following code removes the SKU # and Quantity Options from the Product Details Page:
(I had to take out the first 37 lines because it was to long to post)
Code:
<table cellspacing="0" class="product-properties" summary="{$lng.lbl_description|escape}"> <tr> <td colspan="3" class="product-subtitle"> <div>{$lng.lbl_details}</div> </td> </tr> {* <tr> <td class="property-name">{$lng.lbl_sku}</td> <td class="property-value" id="product_code" colspan="2">{$product.productcode|escape}</td> </tr>*} {if $config.Appearance.show_in_stock eq "Y" and $config.General.unlimited_products ne "Y" and $product.distribution eq ""} <tr> <td class="property-name">{$lng.lbl_in_stock}</td> <td class="property-value product-quantity-text" colspan="2"> {if $product.avail gt 0} {$lng.txt_items_available|substitute:"items":$product.avail} {else} {$lng.lbl_no_items_available} {/if} </td> </tr> {/if} {if $product.weight ne "0.00" or $variants ne ''} <tr id="product_weight_box"{if $product.weight eq '0.00'} style="display: none;"{/if}> <td class="property-name">{$lng.lbl_weight}</td> <td class="property-value" colspan="2"> <span id="product_weight">{$product.weight|formatprice}</span> {$config.General.weight_symbol} </td> </tr> {/if} {if $active_modules.Extra_Fields} {include file="modules/Extra_Fields/product.tpl"} {/if} {if $active_modules.Feature_Comparison} {include file="modules/Feature_Comparison/product.tpl"} {/if} {if $active_modules.Subscriptions and $subscription} {include file="modules/Subscriptions/subscription_info.tpl"} {else} <tr class="separator"> <td colspan="3">&nbsp;</td> </tr> {if $product.appearance.has_market_price and $product.appearance.market_price_discount gt 0} <tr> <td class="property-name product-taxed-price">{$lng.lbl_market_price}:</td> <td class="property-value product-taxed-price" colspan="2">{currency value=$product.list_price}</td> </tr> {/if} <tr> <td class="property-name product-price" valign="top">{$lng.lbl_our_price}:</td> <td class="property-value" valign="top" colspan="2"> {if $product.taxed_price ne 0 or $variant_price_no_empty} <span class="product-price-value">{currency value=$product.taxed_price tag_id="product_price"}</span> <span class="product-market-price">{alter_currency value=$product.taxed_price tag_id="product_alt_price"}</span> {if $product.taxes} <br />{include file="customer/main/taxed_price.tpl" taxes=$product.taxes} {/if} {else} <input type="text" size="7" name="price" /> {/if} </td> </tr> {if $product.forsale ne "B"} <tr> <td colspan="3">{include file="customer/main/product_prices.tpl"}</td> </tr> {/if} {/if} <tr> <td colspan="3" class="product-subtitle"> <div>{$lng.lbl_options}</div> </td> </tr> {if $product.forsale neq "B" or ($product.forsale eq "B" and $smarty.get.pconf ne "" and $active_modules.Product_Configurator)} {if $active_modules.Product_Options ne ""} {include file="modules/Product_Options/customer_options.tpl" disable=$lock_options} {/if} <tr class="quantity-row"> {if $product.appearance.empty_stock and ($variants eq '' or ($variants ne '' and $product.avail le 0))} <td class="property-name product-input">{$lng.lbl_quantity}</td> <td class="property-value" colspan="2"> <script type="text/javascript"> //<![CDATA[ var min_avail = 1; var avail = 0; var product_avail = 0; //]]> </script> <strong>{$lng.txt_out_of_stock}</strong> </td> {elseif not $product.appearance.force_1_amount and $product.forsale ne "B"} <td class="property-name product-input"> {*{if $config.Appearance.show_in_stock eq "Y" and not $product.appearance.quantity_input_box_enabled and $config.General.unlimited_products ne 'Y'} {$lng.lbl_quantity_x|substitute:quantity:$product.avail} {else} {$lng.lbl_quantity} {/if}*} </td> <td class="property-value" colspan="2"> <script type="text/javascript"> //<![CDATA[ var min_avail = {$product.appearance.min_quantity|default:1}; var avail = {$product.appearance.max_quantity|default:1}; var product_avail = {$product.avail|default:"0"}; //]]> </script> <input type="text" id="product_avail_input" name="amount" maxlength="11" size="6" onchange="javascript: return check_quantity_input_box(this);" value="{$smarty.get.quantity|default:$product.appearance.min_quantity}"{if not $product.appearance.quantity_input_box_enabled} disabled="disabled" style="display: none;"{/if}/> {if $product.appearance.quantity_input_box_enabled and $config.Appearance.show_in_stock eq "Y" and $config.General.unlimited_products ne 'Y'} <span id="product_avail_text" class="quantity-text">{$lng.lbl_product_quantity_from_to|substitute:"min":$product.appearance.min_quantity:"max":$product.avail}</span> {/if} <select id="product_avail" name="amount"{if $active_modules.Product_Options ne '' and ($product_options ne '' or $product_wholesale ne '')} onchange="javascript: check_wholesale(this.value);"{/if}{if $product.appearance.quantity_input_box_enabled} disabled="disabled" style="display: none;"{/if}> <option value="{$product.appearance.min_quantity}"{if $smarty.get.quantity eq $product.appearance.min_quantity} selected="selected"{/if}>{$product.appearance.min_quantity}</option> {if not $product.appearance.quantity_input_box_enabled} {section name=quantity loop=$product.appearance.loop_quantity start=$product.appearance.min_quantity} {if %quantity.index% ne $product.appearance.min_quantity} <option value="{%quantity.index%}"{if $smarty.get.quantity eq %quantity.index%} selected="selected"{/if}>{%quantity.index%}</option> {/if} {/section} {/if} </select> </td> {else} <td class="property-name product-input">{$lng.lbl_quantity}</td> <td class="property-value" colspan="2"> <script type="text/javascript"> //<![CDATA[ var min_avail = 0; var avail = 0; var product_avail = 0; //]]> </script> <span class="product-one-quantity">1</span> <input type="hidden" name="amount" value="1" /> {if $product.distribution ne ""} {$lng.txt_product_downloadable} {/if} </td> {/if} </tr> {if $product.min_amount gt 1} <tr> <td colspan="3" class="property-value product-min-amount">{$lng.txt_need_min_amount|substitute:"items":$product.min_amount}</td> </tr> {/if} {/if} </table> {if $product.appearance.buy_now_buttons_enabled} {if $product.forsale ne "B"} <ul class="simple-list"> <li> <div class="buttons-row buttons-auto-separator"> {include file="customer/buttons/add_to_cart.tpl" type="input" additional_button_class="main-button"} {if $product.appearance.dropout_actions} {include file="customer/buttons/add_to_list.tpl" id=$product.productid js_if_condition="FormValidation()"} {elseif $product.appearance.buy_now_add2wl_enabled} {include file="customer/buttons/add_to_wishlist.tpl" href="javascript: if (FormValidation()) submitForm(document.orderform, 'add2wl', arguments[0]);"} {/if} </div> </li> {if $config.Company.support_department neq ""} <li> <div class="ask-question"> {include file="customer/buttons/button.tpl" button_title=$lng.lbl_ask_question_about_product style="link" href="javascript: return !popupOpen(xcart_web_dir + '/popup_ask.php?productid=`$product.productid`')"} </div> <div class="clearing"></div> </li> {/if} </ul> {else} {$lng.txt_pconf_product_is_bundled} {/if} {if $smarty.get.pconf ne "" and $active_modules.Product_Configurator} <input type="hidden" name="slot" value="{$smarty.get.slot}" /> <input type="hidden" name="addproductid" value="{$product.productid}" /> <div class="button-row"> {include file="customer/buttons/button.tpl" button_title=$lng.lbl_pconf_add_to_configuration href="javascript: if (FormValidation()) `$ldelim`document.orderform.productid.value='`$smarty.get.pconf`'; document.orderform.action='pconf.php'; document.orderform.submit();`$rdelim`" additional_button_class="light-button"} </div> {if $product.appearance.empty_stock} <p class="message"> <strong>{$lng.lbl_note}:</strong> {$lng.lbl_pconf_slot_out_of_stock_note} </p> {/if} {if $product.appearance.min_quantity eq $product.appearance.max_quantity} <p>{$lng.txt_add_to_configuration_note|substitute:"items":$product.appearance.min_quantity}</p> {/if} {/if} {/if} </form> {if $active_modules.Product_Options and ($product_options ne '' or $product_wholesale ne '') and ($product.product_type ne "C" or not $active_modules.Product_Configurator)} <script type="text/javascript"> //<![CDATA[ setTimeout(check_options, 200); //]]> </script> {/if}
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #9  
Old 11-14-2011, 11:24 AM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: Remove Quantity on Details Page

In this version, you can see where I started right after the Options Label around line 120. I also disable the SKU #, but that code is not shown. Inserted {if} statements to determine whether or not the $product.productcode = 'Party Deposit1'. If it was, it disabled a warning message and hides of the quantity input and makes it a quantity of 1.

Code:
<tr> <td colspan="3" class="product-subtitle"> <div>{$lng.lbl_options}</div> </td> </tr> {if $product.forsale neq "B" or ($product.forsale eq "B" and $smarty.get.pconf ne "" and $active_modules.Product_Configurator)} {if $active_modules.Product_Options ne ""} {include file="modules/Product_Options/customer_options.tpl" disable=$lock_options} {if $product.productcode eq 'Party Deposit1'} {else} <br /> <font size="1" color="#FF0000"><b>ATTENTION: Packages containing any items with chocolate or candy that could melt that are sent to warm climates must utilize cold packs. ONLY 1 Cold Pack per Order is needed. All Nuts without chocolate do not require Cold Packs, except boiled Peanuts. We recommend Next Day Shipping During warm months! Sorry, no refunds for melted products.</b></font><br /> {/if} <br /> <font size="1" color="#FF0000"><b>All chocolate items are manufactured in a facility that produces items that may contain peanuts, and tree nuts.</b></font> {/if} {if $product.productcode eq 'Party Deposit1'} <tr> <td></td> <td> <script type="text/javascript"> //<![CDATA[ var min_avail = 1; var avail = 1; var product_avail = 1; //]]> </script> <span class="product-one-quantity"></span> <input type="hidden" name="amount" value="1" /> </td> </tr> {else} <tr class="quantity-row"> {if $product.appearance.empty_stock and ($variants eq '' or ($variants ne '' and $product.avail le 0))} <td class="property-name product-input">{$lng.lbl_quantity}</td> <td class="property-value" colspan="2"> <script type="text/javascript"> //<![CDATA[ var min_avail = 1; var avail = 0; var product_avail = 0; //]]> </script> <strong>{$lng.txt_out_of_stock}</strong> </td> {elseif not $product.appearance.force_1_amount and $product.forsale ne "B"} <td class="property-name product-input"> {*{if $config.Appearance.show_in_stock eq "Y" and not $product.appearance.quantity_input_box_enabled and $config.General.unlimited_products ne 'Y'} {$lng.lbl_quantity_x|substitute:quantity:$product.avail} {else} {$lng.lbl_quantity} {/if}*} </td> <td class="property-value" colspan="2"> <script type="text/javascript"> //<![CDATA[ var min_avail = {$product.appearance.min_quantity|default:1}; var avail = {$product.appearance.max_quantity|default:1}; var product_avail = {$product.avail|default:"0"}; //]]> </script> <input type="text" id="product_avail_input" name="amount" maxlength="11" size="6" onchange="javascript: return check_quantity_input_box(this);" value="{$smarty.get.quantity|default:$product.appearance.min_quantity}"{if not $product.appearance.quantity_input_box_enabled} disabled="disabled" style="display: none;"{/if}/> {if $product.appearance.quantity_input_box_enabled and $config.Appearance.show_in_stock eq "Y" and $config.General.unlimited_products ne 'Y'} <span id="product_avail_text" class="quantity-text">{$lng.lbl_product_quantity_from_to|substitute:"min":$product.appearance.min_quantity:"max":$product.avail}</span> {/if} <select id="product_avail" name="amount"{if $active_modules.Product_Options ne '' and ($product_options ne '' or $product_wholesale ne '')} onchange="javascript: check_wholesale(this.value);"{/if}{if $product.appearance.quantity_input_box_enabled} disabled="disabled" style="display: none;"{/if}> <option value="{$product.appearance.min_quantity}"{if $smarty.get.quantity eq $product.appearance.min_quantity} selected="selected"{/if}>{$product.appearance.min_quantity}</option> {if not $product.appearance.quantity_input_box_enabled} {section name=quantity loop=$product.appearance.loop_quantity start=$product.appearance.min_quantity} {if %quantity.index% ne $product.appearance.min_quantity} <option value="{%quantity.index%}"{if $smarty.get.quantity eq %quantity.index%} selected="selected"{/if}>{%quantity.index%}</option> {/if} {/section} {/if} </select> </td> {else} <td class="property-name product-input">{$lng.lbl_quantity}</td> <td class="property-value" colspan="2"> <script type="text/javascript"> //<![CDATA[ var min_avail = 0; var avail = 0; var product_avail = 0; //]]> </script> <span class="product-one-quantity">1</span> <input type="hidden" name="amount" value="1" /> {if $product.distribution ne ""} {$lng.txt_product_downloadable} {/if} </td> {/if} </tr> {/if} {if $product.min_amount gt 1} <tr> <td colspan="3" class="property-value product-min-amount">{$lng.txt_need_min_amount|substitute:"items":$product.min_amount}</td> </tr> {/if} {/if} </table> {if $product.appearance.buy_now_buttons_enabled} {if $product.forsale ne "B"} <ul class="simple-list"> <li> <div class="buttons-row buttons-auto-separator"> {include file="customer/buttons/add_to_cart.tpl" type="input" additional_button_class="main-button"} {if $product.appearance.dropout_actions} {include file="customer/buttons/add_to_list.tpl" id=$product.productid js_if_condition="FormValidation()"} {elseif $product.appearance.buy_now_add2wl_enabled} {include file="customer/buttons/add_to_wishlist.tpl" href="javascript: if (FormValidation()) submitForm(document.orderform, 'add2wl', arguments[0]);"} {/if} </div> </li> {if $config.Company.support_department neq ""} <li> <div class="ask-question"> {include file="customer/buttons/button.tpl" button_title=$lng.lbl_ask_question_about_product style="link" href="javascript: return !popupOpen(xcart_web_dir + '/popup_ask.php?productid=`$product.productid`')"} </div> <div class="clearing"></div> </li> {/if} </ul> {else} {$lng.txt_pconf_product_is_bundled} {/if} {if $smarty.get.pconf ne "" and $active_modules.Product_Configurator} <input type="hidden" name="slot" value="{$smarty.get.slot}" /> <input type="hidden" name="addproductid" value="{$product.productid}" /> <div class="button-row"> {include file="customer/buttons/button.tpl" button_title=$lng.lbl_pconf_add_to_configuration href="javascript: if (FormValidation()) `$ldelim`document.orderform.productid.value='`$smarty.get.pconf`'; document.orderform.action='pconf.php'; document.orderform.submit();`$rdelim`" additional_button_class="light-button"} </div> {if $product.appearance.empty_stock} <p class="message"> <strong>{$lng.lbl_note}:</strong> {$lng.lbl_pconf_slot_out_of_stock_note} </p> {/if} {if $product.appearance.min_quantity eq $product.appearance.max_quantity} <p>{$lng.txt_add_to_configuration_note|substitute:"items":$product.appearance.min_quantity}</p> {/if} {/if} {/if} </form> {if $active_modules.Product_Options and ($product_options ne '' or $product_wholesale ne '') and ($product.product_type ne "C" or not $active_modules.Product_Configurator)} <script type="text/javascript"> //<![CDATA[ setTimeout(check_options, 200); //]]> </script> {/if}
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #10  
Old 11-14-2011, 11:33 AM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: Remove Quantity on Details Page

I also figured out that if you open /common_files/customer/main/cart.tpl and put {*}around line 77 that it turns off the ability for the customer to change the quantity. I assume there's probably some way to if/then/else it based on the $product.productcode, but I haven't tried it yet. If I figure that out, I'll post it.

Code:
<span class="product-price-text"> {*{currency value=$price} x {if $active_modules.Egoods and $product.distribution}1<input type="hidden"{else}<input type="text" size="3"{/if} name="productindexes[{$product.cartid}]" value="{$product.amount}" /> = </span>*}

On a side note, putting {*} around Line 134 in the cart.tpl hides the "Estimate shipping" link in the Cart.

Code:
{*{include file="customer/main/shipping_estimator.tpl"}*}
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 10:42 AM.

   

 
X-Cart forums © 2001-2020