Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Select Quantity Rate Topic   - - - - -

 
  • Cached
  • Member
  • Members
  • Join Date: 02-Mar 11
  • 49 posts

Posted 11 April 2011 - 11:39 PM #1

Hi guy


i want to make SELECT list instead of Checkbox

eg

1
2
3
4

that will be show in the select area, if i chosse 1 they automatically add in the cart
and if click 2 in the select list, they aumatically add 2 products in the cart,

Thanks

 
  • Cached
  • Member
  • Members
  • Join Date: 02-Mar 11
  • 49 posts

Posted 12 April 2011 - 12:04 AM #2

This is my code below, but i will not shown in the page


{if $product.qty_content}
<select name="product_data[{$obj_id}][amount]" id="qty_count_{$obj_prefix}{$obj_id}">
{assign var="a_name" value="product_amount_`$obj_prefix``$obj_id`"}
{assign var="selected_amount" value=false}
{foreach name="`$a_name`" from=$product.qty_content item="var"}
<option value="{$var}" {if $product.selected_amount && ($product.selected_amount == $var || ($smarty.foreach.$a_name.last && !$selected_amount))}{assign var="selected_amount" value=true}selected="selected"{/if}>{$var}</option>
{/foreach}
</select>

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12052 posts

Posted 12 April 2011 - 02:37 AM #3

Where is your qty_content filled and how is it passed to the template?

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • Cached
  • Member
  • Members
  • Join Date: 02-Mar 11
  • 49 posts

Posted 12 April 2011 - 03:26 AM #4

Hello thanks for the reply


here is my complete code, i dont know why is not showing in the page,

<div class="cm-reload-{$obj_prefix}{$obj_id}" id="qty_update_{$obj_prefix}{$obj_id}">
<input type="hidden" name="appearance[show_qty]" value="{$show_qty}" />
<input type="hidden" name="appearance[capture_options_vs_qty]" value="{$capture_options_vs_qty}" />
{if !empty($product.selected_amount)}
{assign var="default_amount" value=$product.selected_amount}
{elseif !empty($product.min_qty)}
{assign var="default_amount" value=$product.min_qty}
{else}
{assign var="default_amount" value="1"}
{/if}

{if ($product.qty_content || $show_qty) && $product.is_edp !== "Y" && $cart_button_exists == true && ($settings.General.allow_anonymous_shopping == "Y" || $auth.user_id)}
<div class="form-field{if !$capture_options_vs_qty} product-list-field{/if}{if $settings.Appearance.quantity_changer == "Y"} changer{/if}" id="qty_{$obj_prefix}{$obj_id}">
<label for="qty_count_{$obj_prefix}{$obj_id}">{$quantity_text|default:$lang.quantity}:</label>
{if $product.qty_content}
<select name="product_data[{$obj_id}][amount]" id="qty_count_{$obj_prefix}{$obj_id}">
{assign var="a_name" value="product_amount_`$obj_prefix``$obj_id`"}
{assign var="selected_amount" value=false}
{foreach name="`$a_name`" from=$product.qty_content item="var"}
<option value="{$var}" {if $product.selected_amount && ($product.selected_amount == $var || ($smarty.foreach.$a_name.last && !$selected_amount))}{assign var="selected_amount" value=true}selected="selected"{/if}>{$var}</option>
{/foreach}
</select>
{else}
{if $settings.Appearance.quantity_changer == "Y"}
<div class="center valign cm-value-changer">
<a class="cm-increase"><img src="{$images_dir}/icons/up_arrow.gif" width="11" height="5" border="0" /></a>
{/if}
<input type="text" size="5" class="input-text-short cm-amount" id="qty_count_{$obj_prefix}{$obj_id}" name="product_data[{$obj_id}][amount]" value="{$default_amount}" />
{if $settings.Appearance.quantity_changer == "Y"}
<a class="cm-decrease"><img src="{$images_dir}/icons/down_arrow.gif" width="11" height="5" border="0" /></a>
</div>
{/if}
{/if}
</div>
{if $product.prices}
{include file="views/products/components/products_qty_discounts.tpl"}
{/if}
{elseif !$bulk_add}
<input type="hidden" name="product_data[{$obj_id}][amount]" value="{$default_amount}" />
{/if}
<!--qty_update_{$obj_prefix}{$obj_id}--></div>


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12052 posts

Posted 12 April 2011 - 03:38 AM #5

Please edit it and used code tags and formatting. It's unreadable.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • Cached
  • Member
  • Members
  • Join Date: 02-Mar 11
  • 49 posts

Posted 12 April 2011 - 03:42 AM #6

hi

here now the code

Thanks

 
  • Cached
  • Member
  • Members
  • Join Date: 02-Mar 11
  • 49 posts

Posted 12 April 2011 - 03:46 AM #7

this code is from product_data.tpl

im gonna that code at, view_main_info.override.tpl

beside of Memory Modules, so client can chosse how many memory they want to put in their systems

Thanks


this is the link of my site
http://dev.amadiinc....product_id=1110

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12052 posts

Posted 12 April 2011 - 03:54 AM #8

Do you know that your override is being loaded or that this code segment is being loaded?
Add a {debug} to the top of the code and see if you get a debug window. Then check that you have values for the things you are conditional upon.

I'd definitely verify that values for all of the variables in this conditional (so glad this is a UI and not business logic).
{if ($product.qty_content || $show_qty) && $product.is_edp !== "Y" && $cart_button_exists == true && ($settings.General.allow_anonymous_shopping == "Y" || $auth.user_id)}

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • Cached
  • Member
  • Members
  • Join Date: 02-Mar 11
  • 49 posts

Posted 12 April 2011 - 04:11 AM #9

it is possible to put select menu at the right of the check box?/

then if click the select automatically add into the cart

i hope you can help me here, cause i tried my code but its not working,

Thanks for the help, i aprreciatte you help. God bless you

see my updated link
http://dev.amadiinc....product_id=1110

 
  • Cached
  • Member
  • Members
  • Join Date: 02-Mar 11
  • 49 posts

Posted 13 April 2011 - 11:59 AM #10

bump

guys please help