[Skip to main content](#vessel-content)

#   show only selected value in checkout

##

- **[kaya](/forum/user/25605-kaya "View kaya's Profile")**
- [![kaya's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/vacation.jpg)](/forum/user/25605-kaya "View kaya's Profile") Topic Author
- [ Offline](/forum/user/25605-kaya)

Less More

- Posts: 120
- Thank you received: 2
-
-
- [](http://arasjoomla.ir)
-

12 years 7 months ago -  12 years 7 months ago [\#152331](#152331) by [kaya](/forum/user/25605-kaya "View kaya's Profile")  *[show only selected value in checkout](/forum/27-checkout/867465-show-only-selected-value-in-checkout#152331 "Hi dear I have a problem in checkout part. when select count product after refresh page only show value 1 but i want show my selected value this is my code:  thank you")* was created by *[kaya](/forum/user/25605-kaya "View kaya's Profile")*

Hi dear
I have a problem in checkout part. when select count product after refresh page only show value 1 but i want show my selected value
this is my code:
Code:

&lt;select id="hikashop_checkout_quantity_&lt;?php echo $row-&gt;cart_product_id;?&gt;" type="text" name="item[&lt;?php echo $row-&gt;cart_product_id;?&gt;]" class="hikashop_product_quantity_field" value="&lt;?php echo $row-&gt;cart_product_quantity; ?&gt;" onchange="var qty_field = document.getElementById('hikashop_checkout_quantity_&lt;?php echo $row-&gt;cart_product_id;?&gt;').value=qty_field.value;"&gt; &lt;option value="1" onclick="var qty_field = document.getElementById('hikashop_checkout_quantity_&lt;?php echo $row-&gt;cart_product_id;?&gt;'); if (qty_field &amp;&amp; qty_field.value != '&lt;?php echo $row-&gt;cart_product_quantity; ?&gt;'){&lt;?php echo $input; ?&gt; qty_field.form.submit(); } return false;" title="&lt;?php echo JText::_('HIKA_REFRESH'); ?&gt;"&gt;1&lt;/option&gt; &lt;option value="2" onclick="var qty_field = document.getElementById('hikashop_checkout_quantity_&lt;?php echo $row-&gt;cart_product_id;?&gt;'); if (qty_field &amp;&amp; qty_field.value != '&lt;?php echo $row-&gt;cart_product_quantity; ?&gt;'){&lt;?php echo $input; ?&gt; qty_field.form.submit(); } return false;" title="&lt;?php echo JText::_('HIKA_REFRESH'); ?&gt;"&gt;2&lt;/option&gt; &lt;option value="3" onclick="var qty_field = document.getElementById('hikashop_checkout_quantity_&lt;?php echo $row-&gt;cart_product_id;?&gt;'); if (qty_field &amp;&amp; qty_field.value != '&lt;?php echo $row-&gt;cart_product_quantity; ?&gt;'){&lt;?php echo $input; ?&gt; qty_field.form.submit(); } return false;" title="&lt;?php echo JText::_('HIKA_REFRESH'); ?&gt;"&gt;3&lt;/option&gt; &lt;/select&gt;

thank you

Last edit: 12 years 7 months ago by [kaya](/forum/user/25605-kaya "View kaya's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg2NzQ2NS1zaG93LW9ubHktc2VsZWN0ZWQtdmFsdWUtaW4tY2hlY2tvdXQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

12 years 7 months ago [\#152389](#152389) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[show only selected value in checkout](/forum/27-checkout/867465-show-only-selected-value-in-checkout#152389 "Hi dear I have a problem in checkout part. when select count product after refresh page only show value 1 but i want show my selected value this is my code:  thank you")*

Hi,

Thanks to try that code: Code:

&lt;select id="hikashop_checkout_quantity_&lt;?php echo $row-&gt;cart_product_id;?&gt;" type="text" name="item[&lt;?php echo $row-&gt;cart_product_id;?&gt;]" class="hikashop_product_quantity_field" value="&lt;?php echo $row-&gt;cart_product_quantity; ?&gt;" onchange="var qty_field = document.getElementById('hikashop_checkout_quantity_&lt;?php echo $row-&gt;cart_product_id;?&gt;').value=qty_field.value;"&gt; &lt;option value="1" &lt;?php if($row-&gt;cart_product_quantity == '1') echo 'selected="selected"'; ?&gt; onclick="var qty_field = document.getElementById('hikashop_checkout_quantity_&lt;?php echo $row-&gt;cart_product_id;?&gt;'); if (qty_field &amp;&amp; qty_field.value != '&lt;?php echo $row-&gt;cart_product_quantity; ?&gt;'){&lt;?php echo $input; ?&gt; qty_field.form.submit(); } return false;" title="&lt;?php echo JText::_('HIKA_REFRESH'); ?&gt;"&gt;1&lt;/option&gt; &lt;option value="2" &lt;?php if($row-&gt;cart_product_quantity == '2') echo 'selected="selected"'; ?&gt; onclick="var qty_field = document.getElementById('hikashop_checkout_quantity_&lt;?php echo $row-&gt;cart_product_id;?&gt;'); if (qty_field &amp;&amp; qty_field.value != '&lt;?php echo $row-&gt;cart_product_quantity; ?&gt;'){&lt;?php echo $input; ?&gt; qty_field.form.submit(); } return false;" title="&lt;?php echo JText::_('HIKA_REFRESH'); ?&gt;"&gt;2&lt;/option&gt; &lt;option value="3" &lt;?php if($row-&gt;cart_product_quantity == '3') echo 'selected="selected"'; ?&gt; onclick="var qty_field = document.getElementById('hikashop_checkout_quantity_&lt;?php echo $row-&gt;cart_product_id;?&gt;'); if (qty_field &amp;&amp; qty_field.value != '&lt;?php echo $row-&gt;cart_product_quantity; ?&gt;'){&lt;?php echo $input; ?&gt; qty_field.form.submit(); } return false;" title="&lt;?php echo JText::_('HIKA_REFRESH'); ?&gt;"&gt;3&lt;/option&gt; &lt;/select&gt;

You forgot to add the "selected" attribute if the value is equal to the product quantity in the cart.

The following user(s) said Thank You: [kaya](/forum/user/25605-kaya "View kaya's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg2NzQ2NS1zaG93LW9ubHktc2VsZWN0ZWQtdmFsdWUtaW4tY2hlY2tvdXQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[kaya](/forum/user/25605-kaya "View kaya's Profile")**
- [![kaya's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/vacation.jpg)](/forum/user/25605-kaya "View kaya's Profile") Topic Author
- [ Offline](/forum/user/25605-kaya)

Less More

- Posts: 120
- Thank you received: 2
-
-
- [](http://arasjoomla.ir)
-

12 years 7 months ago [\#152470](#152470) by [kaya](/forum/user/25605-kaya "View kaya's Profile")  Replied by *[kaya](/forum/user/25605-kaya "View kaya's Profile")* on topic *[show only selected value in checkout](/forum/27-checkout/867465-show-only-selected-value-in-checkout#152470 "Hi dear I have a problem in checkout part. when select count product after refresh page only show value 1 but i want show my selected value this is my code:  thank you")*

thank you it's work now.
I have a new problem in another file. i want to change my input tag to select tag but when change it my delete not work.
my input it's: Code:

&lt;input id="hikashop_cart_quantity_&lt;?php echo $row-&gt;cart_product_id;?&gt;" type="text" name="item[&lt;?php echo $row-&gt;cart_product_id;?&gt;][cart_product_quantity]" class="hikashop_product_quantity_field" value="&lt;?php echo $row-&gt;cart_product_quantity; ?&gt;" onchange="var qty_field = document.getElementById('hikashop_cart_quantity_&lt;?php echo $row-&gt;cart_product_id;?&gt;'); if (qty_field){&lt;?php echo $input; ?&gt; } document.&lt;?php echo $form; ?&gt;.submit(); return false;" /&gt;

and i want change to this select list: Code:

&lt;select id="hikashop_cart_quantity_&lt;?php echo $row-&gt;cart_product_id;?&gt;" type="list" name="item[&lt;?php echo $row-&gt;cart_product_id;?&gt;][cart_product_quantity]" class="hikashop_product_quantity_field" value="&lt;?php echo $row-&gt;cart_product_quantity; ?&gt;" onchange="var qty_field = document.getElementById('hikashop_wishlist_quantity_&lt;?php echo $row-&gt;cart_product_id;?&gt;');" &gt; &lt;option value="1" &lt;?php if($row-&gt;cart_product_quantity == '1') echo 'selected="selected"'; ?&gt; onclick="var qty_field = document.getElementById('hikashop_wishlist_quantity_&lt;?php echo $row-&gt;cart_product_id;?&gt;'); if (qty_field){&lt;?php echo $input; ?&gt; } document.&lt;?php echo $form; ?&gt;.submit(); return false;" &gt;1&lt;/option&gt; &lt;option value="2" &lt;?php if($row-&gt;cart_product_quantity == '2') echo 'selected="selected"'; ?&gt; onclick="var qty_field = document.getElementById('hikashop_wishlist_quantity_&lt;?php echo $row-&gt;cart_product_id;?&gt;'); if (qty_field){&lt;?php echo $input; ?&gt; } document.&lt;?php echo $form; ?&gt;.submit(); return false;" &gt;2&lt;/option&gt; &lt;option value="3" &lt;?php if($row-&gt;cart_product_quantity == '3') echo 'selected="selected"'; ?&gt; onclick="var qty_field = document.getElementById('hikashop_wishlist_quantity_&lt;?php echo $row-&gt;cart_product_id;?&gt;'); if (qty_field){&lt;?php echo $input; ?&gt; } document.&lt;?php echo $form; ?&gt;.submit(); return false;" &gt;3&lt;/option&gt; &lt;/select&gt;

how can change it my delete work?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg2NzQ2NS1zaG93LW9ubHktc2VsZWN0ZWQtdmFsdWUtaW4tY2hlY2tvdXQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[kaya](/forum/user/25605-kaya "View kaya's Profile")**
- [![kaya's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/vacation.jpg)](/forum/user/25605-kaya "View kaya's Profile") Topic Author
- [ Offline](/forum/user/25605-kaya)

Less More

- Posts: 120
- Thank you received: 2
-
-
- [](http://arasjoomla.ir)
-

12 years 7 months ago -  12 years 7 months ago [\#152476](#152476) by [kaya](/forum/user/25605-kaya "View kaya's Profile")  Replied by *[kaya](/forum/user/25605-kaya "View kaya's Profile")* on topic *[show only selected value in checkout](/forum/27-checkout/867465-show-only-selected-value-in-checkout#152476 "Hi dear I have a problem in checkout part. when select count product after refresh page only show value 1 but i want show my selected value this is my code:  thank you")*

I found how can do it...
with add this options its work Code:

&lt;option value="0" style="display: none" &lt;?php if($row-&gt;cart_product_quantity == '0') echo 'selected="selected"'; ?&gt; onclick="var qty_field = document.getElementById('hikashop_wishlist_quantity_&lt;?php echo $row-&gt;cart_product_id;?&gt;'); if (qty_field){&lt;?php echo $input; ?&gt; } document.&lt;?php echo $form; ?&gt;.submit(); return false;" &gt;0&lt;/option&gt;

Last edit: 12 years 7 months ago by [kaya](/forum/user/25605-kaya "View kaya's Profile").

The following user(s) said Thank You: [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg2NzQ2NS1zaG93LW9ubHktc2VsZWN0ZWQtdmFsdWUtaW4tY2hlY2tvdXQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.051 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
