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

#   Limit period

##

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

Less More

- Posts: 7
- Thank you received: 0
-
-

8 years 9 months ago [\#288811](#288811) by [piggersisdaman](/forum/user/54233-piggersisdaman "View piggersisdaman's Profile")  *[Limit period](/forum/4-how-to/893952-limit-period#288811 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.8.5 -- PHP version -- : 7.0  When using the &quot;Limit&quot; feature is it possible to add bi-weekly and every 3 weeks to the drop down?")* was created by *[piggersisdaman](/forum/user/54233-piggersisdaman "View piggersisdaman's Profile")*

-- HikaShop version -- : 3.3.0
-- Joomla version -- : 3.8.5
-- PHP version -- : 7.0

When using the "Limit" feature is it possible to add bi-weekly and every 3 weeks to the drop down?

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

Less More

- Posts: 86587
- Thank you received: 14326
-
-

8 years 8 months ago [\#288826](#288826) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Limit period](/forum/4-how-to/893952-limit-period#288826 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.8.5 -- PHP version -- : 7.0  When using the &quot;Limit&quot; feature is it possible to add bi-weekly and every 3 weeks to the drop down?")*

Hi,

There is no option to add more choices to it.
To do that you would have to:
- modify the code: Code:

$periodicity = array( 'forever' =&gt; 0, 'yearly' =&gt; 1, 'quarterly' =&gt; 2, 'monthly' =&gt; 3, 'weekly' =&gt; 4, 'daily' =&gt; 5, 'cart' =&gt; 6 ); $baseDates = array( 0 =&gt; 0, 1 =&gt; mktime(0,0,0,1,1,$d['year']), 2 =&gt; mktime(0,0,0,$d['mon']-(($d['mon']-1)%4),1,$d['year']), 3 =&gt; mktime(0,0,0,$d['mon'],1,$d['year']), 4 =&gt; mktime(0,0,0,$d['mon'],$d['mday']-$d['wday'],$d['year']), 5 =&gt; mktime(0,0,0,$d['mon'],$d['mday'],$d['year']), 6 =&gt; -1 );

in the file administrator/components/com_hikashop/classes/limit.php to add the new choices in the code which process the limits.
- Edit the file administrator/components/com_hikashop/views/limit/tmpl/form.php and add the new choices in the code below to add them to the dropdown of limits: Code:

$values = array(); $values[] = JHTML::_('select.option', 'cart', JText::_('Cart')); $values[] = JHTML::_('select.option', 'daily', JText::_('Daily')); $values[] = JHTML::_('select.option', 'weekly', JText::_('Weekly')); $values[] = JHTML::_('select.option', 'monthly', JText::_('Monthly')); $values[] = JHTML::_('select.option', 'quarterly', JText::_('Quarterly')); $values[] = JHTML::_('select.option', 'yearly', JText::_('Yearly')); $values[] = JHTML::_('select.option', 'forever', JText::_('Forever')); echo JHTML::_('select.genericlist', $values, "data[limit][limit_periodicity]" , 'class="inputbox" size="1"', 'value', 'text', @$this-&gt;element-&gt;limit_periodicity );

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

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

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

Less More

- Posts: 7
- Thank you received: 0
-
-

8 years 8 months ago -  8 years 8 months ago [\#288846](#288846) by [piggersisdaman](/forum/user/54233-piggersisdaman "View piggersisdaman's Profile")  Replied by *[piggersisdaman](/forum/user/54233-piggersisdaman "View piggersisdaman's Profile")* on topic *[Limit period](/forum/4-how-to/893952-limit-period#288846 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.8.5 -- PHP version -- : 7.0  When using the &quot;Limit&quot; feature is it possible to add bi-weekly and every 3 weeks to the drop down?")*

I added 2 more options and they appear in the drop down menu fine. On the limit.php, it doesn't appear to be working correctly. I tested it and it using the 2 new options and it still allows it to be added to cart without warning.

Is it possible my mktime is incorrect for array 7 and 8?

Thanks for help.
Code:

$d = getdate(); $periodicity = array( 'forever' =&gt; 0, 'yearly' =&gt; 1, 'quarterly' =&gt; 2, 'monthly' =&gt; 3, 'weekly' =&gt; 4, 'daily' =&gt; 5, 'cart' =&gt; 6, 'bi-weekly' =&gt; 7, 'three-weeks' =&gt; 8 ); $baseDates = array( 0 =&gt; 0, 1 =&gt; mktime(0,0,0,1,1,$d['year']), 2 =&gt; mktime(0,0,0,$d['mon']-(($d['mon']-1)%4),1,$d['year']), 3 =&gt; mktime(0,0,0,$d['mon'],1,$d['year']), 4 =&gt; mktime(0,0,0,$d['mon'],$d['mday']-$d['wday'],$d['year']), 5 =&gt; mktime(0,0,0,$d['mon'],$d['mday'],$d['year']), 6 =&gt; -1, 7 =&gt; mktime(0,0,0,$d['mon'],$d['mday']-13,$d['year']), 8 =&gt; mktime(0,0,0,$d['mon'],$d['mday']-20,$d['year']) );

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

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

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

Less More

- Posts: 7
- Thank you received: 0
-
-

8 years 8 months ago [\#288847](#288847) by [piggersisdaman](/forum/user/54233-piggersisdaman "View piggersisdaman's Profile")  Replied by *[piggersisdaman](/forum/user/54233-piggersisdaman "View piggersisdaman's Profile")* on topic *[Limit period](/forum/4-how-to/893952-limit-period#288847 "-- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.8.5 -- PHP version -- : 7.0  When using the &quot;Limit&quot; feature is it possible to add bi-weekly and every 3 weeks to the drop down?")*

I spotted my mistake. I dropped 7 and 8 below 6.
Code:

$d = getdate(); $periodicity = array( 'forever' =&gt; 0, 'yearly' =&gt; 1, 'quarterly' =&gt; 2, 'monthly' =&gt; 3, 'weekly' =&gt; 4, 'daily' =&gt; 5, 'cart' =&gt; 6, 'bi-weekly' =&gt; 7, 'three-weeks' =&gt; 8 ); $baseDates = array( 0 =&gt; 0, 1 =&gt; mktime(0,0,0,1,1,$d['year']), 2 =&gt; mktime(0,0,0,$d['mon']-(($d['mon']-1)%4),1,$d['year']), 3 =&gt; mktime(0,0,0,$d['mon'],1,$d['year']), 4 =&gt; mktime(0,0,0,$d['mon'],$d['mday']-$d['wday'],$d['year']), 5 =&gt; mktime(0,0,0,$d['mon'],$d['mday'],$d['year']), 6 =&gt; -1, 7 =&gt; mktime(0,0,0,$d['mon'],$d['mday']+13,$d['year']), 8 =&gt; mktime(0,0,0,$d['mon'],$d['mday']+20,$d['year']) );

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

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