Skip to main content

Start & End Sale Date

More
14 years 9 months ago #31934 by jjvelmar
Start and End Sale Dates on each product seem like a very good way to manage these items in the system that we have. I read the documentation and it sounds like the products still show up but if someone tries to order them they just get a message that they can't be ordered now (if not within the sale dates).

Is there a way to make it so the items are hidden instead? So people won't see the items until they are on sale?

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago - 12 years 3 months ago #31953 by nicolas
Replied by nicolas on topic Re: Start & End Sale Date
There is no option for that. But you could do it by installing that small plugin

file removed, please use the file in the post #128950

Last edit: 12 years 3 months ago by Jerome.

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago #32111 by jjvelmar
Replied by jjvelmar on topic Re: Start & End Sale Date
hey, thanks so much for your efforts on this. I realize how helpful you are being on this.
Installed the plugin, I enabled it, it gives this error:

Fatal error: Call to undefined method JDatabaseMySQL::isAdmin() in /home/tfcmain/public_html/copy/plugins/hikashop/hide_products.php on line 10

Maybe this matters: we are on Joomla 1.5.23 and Hikashop Business 1.5.3

Thank you.

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago #32145 by nicolas
Replied by nicolas on topic Re: Start & End Sale Date
The line:
$app =& Jfactory::getDBO();
should be :
$app =& Jfactory::getApplication();

in that plugin and that will remove that error.

Please Log in or Create an account to join the conversation.

More
13 years 6 months ago #92551 by kiweerouge
Replied by kiweerouge on topic Start & End Sale Date
I know this topic is old, but I really need this plugin.

Maybe it is because of the hikashop version (I use the last one), but the plugin doesn't works fine : when I enable it, the product with an old end sale date disappears from the site (front and back). In front it is perfect, but not in backoffice.

If I disable the plugin, I can see the product. So, there are 'just' hidden when the plugin is enabled. But it would be much better if the plugin hide them in front, but not in backoffice. (it would be perfect if the plugin can unpublised these products...)

Please Log in or Create an account to join the conversation.

More
13 years 6 months ago #92772 by nicolas
Replied by nicolas on topic Start & End Sale Date
I don't understand your message.

The plugin is working fine for me. It hides the products only on the frontend if their start date is in the future of if their end date is in the past. That's it. It doesn't remove them from the backend at all.

Please Log in or Create an account to join the conversation.

More
13 years 6 months ago #92831 by kiweerouge
Replied by kiweerouge on topic Start & End Sale Date
En front il n'y a pas de soucis, les produits plus en vente sont bien "cachés", mais ils sont cachés en backoffice aussi. Ce qui est assez ennuyant tout de même.
Ils ne sont pas supprimés, puisque si je désactive le plugin les produits réapparaissent, et en front et en back.

Please Log in or Create an account to join the conversation.

More
13 years 6 months ago #92900 by Xavier
Replied by Xavier on topic Start & End Sale Date
Je viens de vérifier le contenu du plugin et si l'interface est backend alors, le plugin n'effectue aucune modification du listing de produits.
Toutefois vous pouvez l'éditer afin de changer son comportement, pour qu'il change le status des produits qui ne sont pas dans les dates de vente en désactivé.

Pouvez vous coller les lignes présentes dans la fonction "onBeforeProductListingLoad()" de ce plugin ?

Please Log in or Create an account to join the conversation.

More
13 years 6 months ago #92904 by kiweerouge
Replied by kiweerouge on topic Start & End Sale Date
Voilà pour le code du plugin :
Code:
function onBeforeProductListingLoad(&$filters){ $app =& Jfactory::getDBO(); if($app->isAdmin()) return; $filters[]='b.product_sale_start<'.time(); $filters[]='(b.product_sale_end=0 OR b.product_sale_end>'.time().')'; }

Please Log in or Create an account to join the conversation.

More
13 years 6 months ago #92905 by Xavier
Replied by Xavier on topic Start & End Sale Date
Merci de remplacer "$app =& Jfactory::getDBO();" par "$app =& Jfactory::getApplication();".

Please Log in or Create an account to join the conversation.

More
13 years 6 months ago #92913 by kiweerouge
Replied by kiweerouge on topic Start & End Sale Date
Super, merci !

Please Log in or Create an account to join the conversation.

More
12 years 11 months ago #128950 by nicolas
Replied by nicolas on topic Start & End Sale Date
Note that the plugin I posted more than a year ago won't install on Joomla 3 as at the time it couldn't be compatible with it.
Here is a version which is compatible with Joomla 3.

This attachment is hidden for guests.
Please log in or register to see it.
The following user(s) said Thank You: cb75ter, OA

Please Log in or Create an account to join the conversation.

More
12 years 5 months ago #153001 by mtense
Replied by mtense on topic Start & End Sale Date
You guys should make this a standard plugin that you ship. We have been using a hacky workaround for years.

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago - 12 years 3 months ago #157991 by mtense
Replied by mtense on topic Start & End Sale Date
So, we have been using this and it works pretty well. The problem is that it hides the product on both the front end and back end. So, when we set the start date to the future, the product disappears and we can't edit it again until after the start date. Can this be corrected?

I see in the code that it attempts to return if the use is admin

if($app->isAdmin()) return;

but this doesn't seem to work. We are still on hika 2.0

Thanks
Last edit: 12 years 3 months ago by mtense. Reason: added detail

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago #158030 by Xavier
Replied by Xavier on topic Start & End Sale Date
Hi,

I just checked the plugin code, and that should work fine. Are you sure that you don't have an old override or edition present in your code ?

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago #158206 by mtense
Replied by mtense on topic Start & End Sale Date
Yes, I am sure. To double-check, I setup a test installation
  • latest version of joomla
  • hika business 2.0
  • hide products plug in
That is all. Then i added two products. One product I set start sale date to tomorrow. If I enable the hide product plugin, the product disappears from both front and back end. If I disable the plugin, the product comes back.

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago #158207 by mtense
Replied by mtense on topic Start & End Sale Date
The fix is pretty simple. In the version of the plugin I had the code looked like this

$app =& Jfactory::getDBO();
if($app->isAdmin()) return;

I changed this to

$app = JFactory::getApplication();
if($app->isAdmin()) return;

And it started working correctly.
The following user(s) said Thank You: Jerome

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago #158231 by Jerome
Replied by Jerome on topic Start & End Sale Date
Hi,

Thanks for the patch.
The weird thing is that, in my side (when I look at the source code of the plugin in our repository), the variable $app is right initialized with the application and not with the DBO.

Regards,

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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago #158236 by mtense
Replied by mtense on topic Start & End Sale Date
There are two attachments on this thread. Somehow I ended up with the first. Kind of my mistake. I suggest deleting the first one and make renaming the second one to hide_product.zip. Maybe that is how I ended up with the bad code. The good code has a bad zip name ;)

Please Log in or Create an account to join the conversation.

More
2 years 10 months ago #356827 by WoodyF4u
Replied by WoodyF4u on topic Start & End Sale Date
Is the plugin file in this post also compatible / ready for Joomla 4 and 5?
www.hikashop.com/support/forum/4-how-to/...ale-date.html#128950

Best regards,
Wouter

Please Log in or Create an account to join the conversation.

Time to create page: 0.391 seconds
Powered by Kunena Forum