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

#   Add To Cart with Custom Field problem

##

- **[nathangoss](/forum/user/17390-nathangoss "View nathangoss's Profile")**
- [![nathangoss's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/crossing_kangaroo.png)](/forum/user/17390-nathangoss "View nathangoss's Profile") Topic Author
- [ Offline](/forum/user/17390-nathangoss)

Less More

- Posts: 2
- Thank you received: 0
-
-

13 years 6 months ago -  13 years 6 months ago [\#100991](#100991) by [nathangoss](/forum/user/17390-nathangoss "View nathangoss's Profile")  *[Add To Cart with Custom Field problem](/forum/3-bug-report/80969-add-to-cart-with-custom-field-problem#100991 "Hi There,  I have added a Custom Field, of type &quot;item&quot; to my shop. I associated that to just one Product Category.  It is a simple text box, and is displayed correctly on the listing of products in a category, as well as on each single product page in that category. Adding a value to the text box correctly includes that value with the product when it is added to the Cart.  This is where I am finding an issue.  If I enter a value in my field when on a Category page, and click &quot;Add To Cart&quot; the process works as normal - the product is added to my cart, and I stay on the same page.  If I am on a single product page, enter a value in my custom field, and click &quot;Add To Cart&quot; it does actually add it to the cart, but instead of staying on the same page, it takes me to the Checkout process.  If I un-publish the Custom field, the process of adding to cart from the specific product page works as normal, so it is specifically to do with having a Custom Field on a product.  Can anybody think of what might be causing this issue, and ideas on how to fix it?  Many thanks,  Nathan")* was created by *[nathangoss](/forum/user/17390-nathangoss "View nathangoss's Profile")*

Hi There,

I have added a Custom Field, of type "item" to my shop. I associated that to just one Product Category.

It is a simple text box, and is displayed correctly on the listing of products in a category, as well as on each single product page in that category. Adding a value to the text box correctly includes that value with the product when it is added to the Cart.

This is where I am finding an issue.

If I enter a value in my field when on a Category page, and click "Add To Cart" the process works as normal - the product is added to my cart, and I stay on the same page.

If I am on a single product page, enter a value in my custom field, and click "Add To Cart" it does actually add it to the cart, but instead of staying on the same page, it takes me to the Checkout process.

If I un-publish the Custom field, the process of adding to cart from the specific product page works as normal, so it is specifically to do with having a Custom Field on a product.

Can anybody think of what might be causing this issue, and ideas on how to fix it?

Many thanks,

Nathan

Last edit: 13 years 6 months ago by [nathangoss](/forum/user/17390-nathangoss "View nathangoss's Profile"). Reason: More accurate Subject

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

- **[nathangoss](/forum/user/17390-nathangoss "View nathangoss's Profile")**
- [![nathangoss's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/crossing_kangaroo.png)](/forum/user/17390-nathangoss "View nathangoss's Profile") Topic Author
- [ Offline](/forum/user/17390-nathangoss)

Less More

- Posts: 2
- Thank you received: 0
-
-

13 years 6 months ago [\#101002](#101002) by [nathangoss](/forum/user/17390-nathangoss "View nathangoss's Profile")  Replied by *[nathangoss](/forum/user/17390-nathangoss "View nathangoss's Profile")* on topic *[Add To Cart with Custom Field problem](/forum/3-bug-report/80969-add-to-cart-with-custom-field-problem#101002 "Hi There,  I have added a Custom Field, of type &quot;item&quot; to my shop. I associated that to just one Product Category.  It is a simple text box, and is displayed correctly on the listing of products in a category, as well as on each single product page in that category. Adding a value to the text box correctly includes that value with the product when it is added to the Cart.  This is where I am finding an issue.  If I enter a value in my field when on a Category page, and click &quot;Add To Cart&quot; the process works as normal - the product is added to my cart, and I stay on the same page.  If I am on a single product page, enter a value in my custom field, and click &quot;Add To Cart&quot; it does actually add it to the cart, but instead of staying on the same page, it takes me to the Checkout process.  If I un-publish the Custom field, the process of adding to cart from the specific product page works as normal, so it is specifically to do with having a Custom Field on a product.  Can anybody think of what might be causing this issue, and ideas on how to fix it?  Many thanks,  Nathan")*

I have done a little digging, and can see the following code is displayed for the Add To Cart button:

Code with Custom Field turned on - Add to Cart goes to Checkout (not normal):
&lt;input type="submit" class="button hikashop_cart_input_button" name="add" value="Add to cart" onclick="var field=document.getElementById('hikashop_product_quantity_field_1');if(hikashopCheckChangeForm('item','hikashop_product_form')){ return hikashopModifyQuantity('38',field,1,**'hikashop\_product\_form'**,'cart'); } else { return false; }"&gt;

Code with Custom Field disabled - Add to Cart works as normal, and stays on page:
&lt;input type="submit" class="button hikashop_cart_input_button" name="add" value="Add to cart" onclick="var field=document.getElementById('hikashop_product_quantity_field_1');if(hikashopCheckChangeForm('item','hikashop_product_form')){ return hikashopModifyQuantity('38',field,1,0,'cart'); } else { return false; }"&gt;

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86320
- Thank you received: 14279
-
-

13 years 6 months ago [\#101303](#101303) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Add To Cart with Custom Field problem](/forum/3-bug-report/80969-add-to-cart-with-custom-field-problem#101303 "Hi There,  I have added a Custom Field, of type &quot;item&quot; to my shop. I associated that to just one Product Category.  It is a simple text box, and is displayed correctly on the listing of products in a category, as well as on each single product page in that category. Adding a value to the text box correctly includes that value with the product when it is added to the Cart.  This is where I am finding an issue.  If I enter a value in my field when on a Category page, and click &quot;Add To Cart&quot; the process works as normal - the product is added to my cart, and I stay on the same page.  If I am on a single product page, enter a value in my custom field, and click &quot;Add To Cart&quot; it does actually add it to the cart, but instead of staying on the same page, it takes me to the Checkout process.  If I un-publish the Custom field, the process of adding to cart from the specific product page works as normal, so it is specifically to do with having a Custom Field on a product.  Can anybody think of what might be causing this issue, and ideas on how to fix it?  Many thanks,  Nathan")*

Hi,

Can you make sure that the "when a product is added to the cart" option of the configuration is set to "always stay on the current page" ?

The fact that you have that change between having the custom field and not having it is normal actually. That's because the system has to use the form of the page when there is a custom field.
If you hadn't that, the custom field value would not be added to the cart.

The issue with the redirection is something else. Probably just an issue with the "when a product is added to the cart" option or something like that.
Also, please make sure that you have the latest version.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC84MDk2OS1hZGQtdG8tY2FydC13aXRoLWN1c3RvbS1maWVsZC1wcm9ibGVtP3RtcGw9bWFya2Rvd24=) 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.073 seconds

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

[](#top)
