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

#   hikashop module

##

- **[ebrahimahamdi](/forum/user/45709-ebrahimahamdi "View ebrahimahamdi's Profile")**
- [![ebrahimahamdi's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/45709-ebrahimahamdi "View ebrahimahamdi's Profile") Topic Author
- [ Offline](/forum/user/45709-ebrahimahamdi)

Less More

- Posts: 56
- Thank you received: 0
-
-

8 years 6 months ago -  8 years 6 months ago [\#290581](#290581) by [ebrahimahamdi](/forum/user/45709-ebrahimahamdi "View ebrahimahamdi's Profile")  *[hikashop module](/forum/31-development/894305-hikashop-module#290581 "i developed a module for hikashop product view but there is problem. i don't know how to force the module to follow hikashop configuration rules. in hikashop configuration i choose when &quot;add to cart&quot; clicked &quot;stay on same page and show a pop up&quot;, but this module go to checkout directly. how can i fix this ? is there any block of code to do that ? regard")* was created by *[ebrahimahamdi](/forum/user/45709-ebrahimahamdi "View ebrahimahamdi's Profile")*

i developed a module for hikashop product view but there is problem. i don't know how to force the module to follow hikashop configuration rules.
in hikashop configuration i choose when "add to cart" clicked "stay on same page and show a pop up", but this module go to checkout directly. how can i fix this ?
is there any block of code to do that ?
regard

Last edit: 8 years 6 months ago by [ebrahimahamdi](/forum/user/45709-ebrahimahamdi "View ebrahimahamdi's Profile").

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

8 years 6 months ago [\#290582](#290582) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[cart module](/forum/31-development/894305-hikashop-module#290582 "i developed a module for hikashop product view but there is problem. i don't know how to force the module to follow hikashop configuration rules. in hikashop configuration i choose when &quot;add to cart&quot; clicked &quot;stay on same page and show a pop up&quot;, but this module go to checkout directly. how can i fix this ? is there any block of code to do that ? regard")*

Hello,

Please provide your HikaShop version number.
Also, please note that you're talking about legacy settings.
[ www.hikashop.com/support/documentation/5...html#advanced\_legacy](https://www.hikashop.com/support/documentation/54-hikashop-config.html#advanced_legacy)

Regards

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

- **[ebrahimahamdi](/forum/user/45709-ebrahimahamdi "View ebrahimahamdi's Profile")**
- [![ebrahimahamdi's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/45709-ebrahimahamdi "View ebrahimahamdi's Profile") Topic Author
- [ Offline](/forum/user/45709-ebrahimahamdi)

Less More

- Posts: 56
- Thank you received: 0
-
-

8 years 6 months ago [\#290652](#290652) by [ebrahimahamdi](/forum/user/45709-ebrahimahamdi "View ebrahimahamdi's Profile")  Replied by *[ebrahimahamdi](/forum/user/45709-ebrahimahamdi "View ebrahimahamdi's Profile")* on topic *[cart module](/forum/31-development/894305-hikashop-module#290652 "i developed a module for hikashop product view but there is problem. i don't know how to force the module to follow hikashop configuration rules. in hikashop configuration i choose when &quot;add to cart&quot; clicked &quot;stay on same page and show a pop up&quot;, but this module go to checkout directly. how can i fix this ? is there any block of code to do that ? regard")*

hikashop version is 3.3
and the legacy setting is off.
would you tell where and how to use fallback functions.
it is my default module file :
how can implement the fallback function and use it here Code:

&lt;?php defined('_JEXEC') or die('Restricted access'); if(!empty($products)) : ?&gt; &lt;div class="hikashop_tglproducts_module&lt;?php echo $moduleclass_sfx; ?&gt;" id="hikashop_tglproducts_module"&gt; &lt;div class="row"&gt; &lt;?php foreach ($products as $product): ?&gt; &lt;div class="product-item col bg-white mx-1 p-2" id="product-&lt;?php echo $product['product_id']; ?&gt;"&gt; &lt;div class="product-img"&gt; &lt;img class="img-fluid" src="&lt;?php echo $product['image']; ?&gt;" alt="&lt;?php echo $product['product_name']; ?&gt;" /&gt; &lt;/div&gt; &lt;form class="form pt-2"&gt; &lt;div class="form-group row mb-2"&gt; &lt;label for="" class="col-sm-6 col-form-label"&gt;&lt;?php echo $product['product_name']; ?&gt;&lt;/label&gt; &lt;div class="col-sm-6"&gt; &lt;select class="form-control custom-select product-charactgleristic"&gt; &lt;?php $first = true; foreach ($product['characteristic'] as $ccItem): ?&gt; &lt;option value="&lt;?php echo $ccItem['id']; ?&gt;" data-pid="&lt;?php echo $ccItem['pid']; ?&gt;" data-amount="&lt;?php echo $ccItem['amount']; ?&gt;" &lt;?php if($first) {$first = false; echo 'selected="selected"'; } ?&gt;&gt; &lt;?php echo $ccItem['alias']; ?&gt; &lt;/option&gt; &lt;?php endforeach; ?&gt; &lt;/select&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="lead text-center pb-2 product-price"&gt; &lt;?php echo $currency-&gt;format((isset($product['characteristic'][0]['amount']) ? $product['characteristic'][0]['amount'] : 0), hikashop_getCurrency()); ?&gt; &lt;/div&gt; &lt;div class="form-group row"&gt; &lt;div class="input-group col-sm-12"&gt; &lt;div class="input-group-append product-qinc"&gt; &lt;span class="input-group-text"&gt;+&lt;/span&gt; &lt;/div&gt; &lt;input type="text" class="form-control text-center product-quantity" placeholder="&lt;?php echo JText::_('MOD_HIKASHOP_TGLPRODUCTS_COUNT'); ?&gt;" value="1"&gt; &lt;div class="input-group-prepend product-qdec"&gt; &lt;span class="input-group-text"&gt;-&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;a class="btn btn-block hikabtn hikacart tglproduct_addtocart" href="index.php/component/hikashop/product/updatecart/add-1/cid-&lt;?php echo (isset($product['characteristic'][0]['pid']) ? $product['characteristic'][0]['pid'] : $product['product_id']); ?&gt;/quantity-1"&gt;&lt;?php echo JText::_('MOD_HIKASHOP_TGLPRODUCTS_ADD_TO_CART'); ?&gt;&lt;/a&gt; &lt;/form&gt; &lt;/div&gt; &lt;?php endforeach; ?&gt; &lt;/div&gt; &lt;/div&gt; &lt;script&gt; jQuery(document).ready(function () { // Get currency var priceFormat = '&lt;?php echo $currency-&gt;format(0, hikashop_getCurrency()); ?&gt;'; var priceFormatParts = priceFormat.trim().split(' '); var currency = priceFormatParts.pop(); var baseAddLink = 'index.php/component/hikashop/product/updatecart/add-1/'; jQuery('.product-qinc').click(function () { var productQuantityField = jQuery(this).parent().children('input.product-quantity'); productQuantityField.val(parseInt(productQuantityField.val()) + 1); createAddLink(this); }); jQuery('.product-qdec').click(function () { var productQuantityField = jQuery(this).parent().children('input.product-quantity'); productQuantityField.val(parseInt(productQuantityField.val()) - 1); createAddLink(this); }); jQuery('.product-charactgleristic').change(function () { var amount = jQuery("option[value=" + jQuery(this).val() + "]", this).attr('data-amount'); // change amount jQuery(this).parents('form').children('.product-price').html(amount + ' ' + currency); createAddLink(this); }); function createAddLink(currentPosition) { var productParent = jQuery(currentPosition).parents("div[id^='product-']"); var pid = productParent.find('select.product-charactgleristic').find("option:selected").attr('data-pid'); var quantity = productParent.find('input.product-quantity').val(); var propString = 'cid-' + pid + '/quantity-' + quantity; productParent.find('a.tglproduct_addtocart').attr('href', baseAddLink + propString); } }); &lt;/script&gt; &lt;?php endif;

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg5NDMwNS1oaWthc2hvcC1tb2R1bGU/dG1wbD1tYXJrZG93bg==) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86289
- Thank you received: 14265
-
-

8 years 6 months ago [\#290666](#290666) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[cart module](/forum/31-development/894305-hikashop-module#290666 "i developed a module for hikashop product view but there is problem. i don't know how to force the module to follow hikashop configuration rules. in hikashop configuration i choose when &quot;add to cart&quot; clicked &quot;stay on same page and show a pop up&quot;, but this module go to checkout directly. how can i fix this ? is there any block of code to do that ? regard")*

Hi,

If you want to use the direct add to cart URL and not the javascript functions HikaShop provides, then you need to add an extra "url" parameter to your add to cart URL with the URL where you want to be redirected to after the add to cart process. The URL you add as value of that parameter needs to be urlencoded.

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

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

[](#top)
