X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Getting RID of theQuantity 'input' field and get the dropdown (https://forum.x-cart.com/showthread.php?t=49467)

Kiwami 09-01-2009 12:13 PM

Getting RID of theQuantity 'input' field and get the dropdown
 
I'm running x-cart 4.2.2 Vivid Dreams a 'little' modified.. but I know i didn't touch product(s).tpl .. in admin under appearance.. my maximum number of selections is 15, number of items which quantity should be displayed is 15 and buy now is off (i turned it on and no diffrence but it did say 'enter a number between 1 to 1000') .
Please tell me what i'm doing wroing :(

- Thank you

candc 09-01-2009 01:25 PM

Re: Getting RID of theQuantity 'input' field and get the dropdown
 
Are you referring to the quantity box?

If so that is under general settings/product options

ARW VISIONS 09-01-2009 01:33 PM

Re: Getting RID of theQuantity 'input' field and get the dropdown
 
weird, the drop down box is the default behavior. Something has bee changed. Post the contents of your product.tpl.

ARW VISIONS 09-01-2009 01:36 PM

Re: Getting RID of theQuantity 'input' field and get the dropdown
 
oh, well the default for that is 500, and he said his was set to 15.

Was this changed?

Number of items up to which the Quantity box should be displayed as a selectbox (With larger numbers, the box will appear as an input box)

ARW VISIONS 09-01-2009 01:42 PM

Re: Getting RID of theQuantity 'input' field and get the dropdown
 
I can't get the input box to show up on my test site, I currently have 10,000 in the qty drop down box.

Kiwami 09-01-2009 05:05 PM

Re: Getting RID of theQuantity 'input' field and get the dropdown
 
I dunno. i cant post the entire produts.tpl .. it says its too big.. hope i posted the right part
Code:

    <div class="details"{if $max_image_width gt 0} style="margin-left: {$max_image_width}px;"{/if}>

      <form name="orderform" method="post" action="cart.php" onsubmit="javascript: return FormValidation();">
        <input type="hidden" name="mode" value="add" />
        <input type="hidden" name="productid" value="{$product.productid}" />
        <input type="hidden" name="cat" value="{$smarty.get.cat|escape:"html"}" />
        <input type="hidden" name="page" value="{$smarty.get.page|escape:"html"}" />

        <div class="descr">{$product.fulldescr|default:$product.descr}</div>

        <table cellspacing="0" class="product-properties" summary="{$lng.lbl_details|escape}">

          <tr>
            <td colspan="2" 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">{$product.productcode|escape}</td> *}
          </tr>

          {if $config.Appearance.show_in_stock eq "Y" && $config.General.unlimited_products ne "Y" && $product.distribution eq ""}
            <tr>
                    <td class="property-name">{$lng.lbl_in_stock}</td>
              <td class="property-value" id="product_avail_txt">
                {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" || $variants ne ''}
            <tr id="product_weight_box">
                    <td class="property-name">{$lng.lbl_weight}:</td>
                    <td class="property-value">
                <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 && $subscription}

            {include file="modules/Subscriptions/subscription_info.tpl"}

          {else}

            <tr class="separator">
              <td>&nbsp;</td>
            </tr>

            <tr>
              <td class="property-name product-price">{$lng.lbl_price}:</td>
              <td class="property-value">

                {if $product.taxed_price ne 0 || $variant_price_no_empty}
                  <span class="product-price-value">{include file="currency.tpl" value=$product.taxed_price tag_id="product_price"}</span>
                  <span class="product-market-price">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$product.taxed_price tag_id="product_alt_price"}</span>

                  {if $product.taxes}
                    {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="2">
                  {include file="customer/main/product_prices.tpl"}
                </td>
              </tr>
            {/if}

          {/if}

          <tr>
            <td colspan="2" class="product-subtitle">&nbsp;
           
            </td>
          </tr>

          {if $product.forsale neq "B" || ($product.forsale eq "B" && $smarty.get.pconf ne "" && $active_modules.Product_Configurator)}

            {if $active_modules.Product_Options ne ""}
              {include file="modules/Product_Options/customer_options.tpl"}
            {/if}

            <tr>
              <td class="property-name product-input">
                {$lng.lbl_quantity}
                {if $product.min_amount gt 1}
                  <div class="product-min-amount">{$lng.txt_need_min_amount|substitute:"items":$product.min_amount}</div>
                {/if}

              </td>
              <td class="property-value">

                {if $product.appearance.empty_stock && ($variants eq '' || ($variants ne '' && $product.avail le 0))}

<script type="text/javascript">
<!--
var min_avail = 1;
var avail = 0;
var product_avail = 0;
-->
</script>

                  <strong>{$lng.txt_out_of_stock}</strong>

                {elseif !$product.appearance.force_1_amount && $product.forsale ne "B"}

<script type="text/javascript">
<!--
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.quantity_input_box_enabled} disabled="disabled" style="display: none;"{/if}/>

                  <select id="product_avail" name="amount"{if $active_modules.Product_Options ne '' && ($product_options ne '' || $product_wholesale ne '')} onchange="javascript: check_wholesale(this.value);"{/if}{if $product.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.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>

                {else}

<script type="text/javascript">
<!--
var min_avail = 1;
var avail = 1;
var product_avail = 1;
-->
</script>

                  <span class="product-one-quantity">1</span>
                  <input type="hidden" name="amount" value="1" />

                  {if $product.distribution ne ""}
                    {$lng.txt_product_downloadable}
                  {/if}

                {/if}

              </td>
            </tr>

          {/if}

        </table>

        {if $product.appearance.buy_now_buttons_enabled}

          {if $product.forsale ne "B"}

            <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.buy_now_add2wl_enabled && $js_enabled}
                {include file="customer/buttons/add_to_wishlist.tpl" href="javascript: if (FormValidation()) submitForm(document.orderform, 'add2wl', arguments[0]);" additional_button_class="simple-arrow-button" style="link"}
              {/if}


            </div>

          {else}

            {$lng.txt_pconf_product_is_bundled}

          {/if}

          {if $smarty.get.pconf ne "" && $active_modules.Product_Configurator && $js_enabled}

            <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="simple-arrow-button" style="link"}
            </div>

            {if $product.appearance.empty_stock}
              <p class="message">
                <strong>{$lng.lbl_note}:</strong> {$lng.lbl_pconf_slot_out_of_stock_note}
              </p>
            {/if}

            <p>{$lng.txt_add_to_configuration_note}</p>

          {/if}

        {/if}

      </form>


Shamun 09-01-2009 05:22 PM

Re: Getting RID of theQuantity 'input' field and get the dropdown
 
In the 'General settings' look for 'Product options'

In there set it like this:
Unchecked
500
Checked

Then go into 'Appearence' and set Maximum number of items that can be displayed in or can be entered into the Quantity box to 5

Let me know what happens.

ARW VISIONS 09-02-2009 02:10 AM

Re: Getting RID of theQuantity 'input' field and get the dropdown
 
I can't get the QTY input field to change to a text box no matter what I do... lol

Kiwami 09-02-2009 09:55 AM

Re: Getting RID of theQuantity 'input' field and get the dropdown
 
1 Attachment(s)
I dunno man.. I might just go in and put a dropdown box myself.. unless it's an enormous human error on my part, I wen't as far as to changing the skin and it was still input boxes.
I attached my 'product options' look like so
Quote:

Unchecked
500
Checked

isn't there :(

Shamun 09-02-2009 10:16 AM

Re: Getting RID of theQuantity 'input' field and get the dropdown
 
Theres a problem then...
Granted im running 4.2.1, you should still have a text field asking for that info...

You should either
A) Check all the settings page in 'General settings' for that input box or..
B) Go the lazy way and open up the xcart_config table in your MySQL database. Look for the row with quantity_select_box_limit and make sure the value is set to 500. If you go this route, I suggest backing up your mysql DB.

Kiwami 09-02-2009 12:03 PM

Re: Getting RID of theQuantity 'input' field and get the dropdown
 
changed it to 500.. still have an input box :( this is bizzare .. I have another site running 4.2.2 and it's perfect.. i dunno man

Shamun 09-02-2009 12:06 PM

Re: Getting RID of theQuantity 'input' field and get the dropdown
 
Go to the 'modules' section on the left hand side of the admin area. Make sure product options is enabled.
If it is, I have no idea why its not working.

Kiwami 09-02-2009 12:10 PM

Re: Getting RID of theQuantity 'input' field and get the dropdown
 
lol.. yeah.. i'm really lost here. Its enabled.

gb2world 09-09-2009 11:17 PM

Re: Getting RID of theQuantity 'input' field and get the dropdown
 
Hi Kiwami -

Just wanted to report I see the same issue on a 4.2.2 X-CART. Everything was working properly until I started adding options/variants to a product.

I see by looking at the differences between 4.2.1 & 4.2.2 - this was an area which was modified - both in the administration and the front end display for 4.2.2

My troubles started when I added product options and variants to a product - then something stuck which is causing various smarty "input_box_enabled" variables to stay set. These variables, when set, will display an input text box no matter what else is set. I suspect there is a bug hidden in the php - not the templates.

Unless there is a setting in the admin somewhere that I don't know about that would set variables like $product.quantity_input_box_enabled??

I'm under the gun right now - so I don't have time to do the steps to verify that it is a bug. For now - I hacked product.tpl and buy_now.tpl to remove the option to display an input text box for quantity - which I don't ever foresee needing. (This cart will never have large quantities to purchase)

Gaelle 09-23-2009 12:59 AM

Re: Getting RID of theQuantity 'input' field and get the dropdown
 
Heya,

I'm using 4.2.2 and have the same problem as above.

Can you share what you did to edit the product.tpl and buy-now.tpl as I'd like to do the same but wouldn't dare touch it without guidance. :)

Thank you.

spence88mph 09-23-2009 04:02 AM

Re: Getting RID of theQuantity 'input' field and get the dropdown
 
I have the same issue with 4.2.2, very frustrating, time to hack product.tpl!

gb2world 09-23-2009 11:41 AM

Re: Getting RID of theQuantity 'input' field and get the dropdown
 
1 Attachment(s)
I've attached my modified product.tpl. Remember - this is not a fix - it is just a hack - so use with caution.
It removes from the template decisions based on this variable: $product.quantity_input_box_enabled

with the impact of never allowing the quantity box to be input text.

I suspect the setting of that variable might have a problem - but have not had time to figure out how to duplicate the issue so it can reported as a bug.

It would not be a bad idea for someone to review the hack to make sure I am not missing any unintended consequences.

webxonelex 11-11-2010 09:50 AM

Re: Getting RID of theQuantity 'input' field and get the dropdown
 
My question is slightly different. I would like to replace the input box as well but the customer wants only the specified quantities to be in the drop down for the reseller (ie; 12,25,50,...500). I other words, the customer doesn't want to sell quantities in between ranges. They are exact quantities only :roll: .. Does anyone have any suggestions on how I should approach this in light of all that has been posted here? I would appreciate any input on this. Thanks!


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

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.