Jump to content

[MODULE] Sale Category - apply a reduction / "on sale" status to all the products of a category


Recommended Posts

Hi all,

 

A module that allows to apply a discount to all products of a category and / or apply the "on sale" status to the products.

 

The reverse is also possible, that is to remove the discounts/"on sale status" for all products of a category.

 

The module is available for download on our website:

http://btcdev.net/?cat=4

 

Regards,

 

BTConsulting

  • Like 4

Share this post


Link to post
Share on other sites
  • 4 weeks later...

this mod will save me many many hours of time.

I wanted to post up because i looked threw the code and thought i would post up this up if someone wants it to react the way i wanted it too.

 

comment out this. at around 216 // SpecificPrice::deleteByProductId($id_product);

 

Then at 135 before the </fieldset> tag add this

 

   	 <label>'.$this->l('Quantity:').' </label>
              	 <div class="margin-form">
                  	 <input type="text" name="sp_from_quantity" value="0" size="11" />

                  	 '.$this->l('(enter the quantity of items for discount here)').'
              	 </div>        

 

now you can add multiple price tiers.

 

btc.dev i want to thank you again.

Share this post


Link to post
Share on other sites

For me all products are showing reduced price, but not the exact reduction on product page. Normally there is: (price reduced in 5%). This is not showing anymore. How to configure ?

Share this post


Link to post
Share on other sites

Thanks devilsown for the contribution to the module.

 

I have integrated your change in the standard module, I have modified it so that the default quantity is 1 instead of 0 because with a quantity of 0 the product does not appear in the price drop page and also if the product already has a reduction for the same quantity and dates (or no dates) then this reduction is deleted otherwise the reduction from the module is not applied.

 

The updated version is available on our website

http://btcdev.net/2011/11/30/sale-category/

 

Best regards,

 

BTConsulting

Share this post


Link to post
Share on other sites

@cd2500

Do you still have the problem ? If you apply a reduction manually do you have the same issue ?

The module is using the standard Prestashop specific price mechanism so if it does not show up maybe it's a problem with your template.

 

Best regards,

 

BTConsulting

 

 

The 1.3 version of the module has been updated as there was an error with Prestashop 1.3.1

Share this post


Link to post
Share on other sites

 

 

Hello!

 

Thanks for this great module.

 

What changes should I do to apply the discount to a certain group of users?

 

By default, makes the discount to everyone, and I would like to choose the discount to a specific group.

 

Thank you very much for the great input!

 

 

 

Share this post


Link to post
Share on other sites

@cd2500

Do you still have the problem ? If you apply a reduction manually do you have the same issue ?

The module is using the standard Prestashop specific price mechanism so if it does not show up maybe it's a problem with your template.

 

Best regards,

 

BTConsulting

 

 

The 1.3 version of the module has been updated as there was an error with Prestashop 1.3.1

 

Hi, you are right, the problem was, I was testing it on my testserver before having it in the live-shops. Here I was using before the buggy 1.4.5.1 template. It has cached something wrong. Now all is displayed also in my own template as it should.

 

Sorry... This cache is making me crazy sometimes...

 

Thxs for great module.

Share this post


Link to post
Share on other sites
  • 2 weeks later...

yes its right.

I noticed that i cant apply the discount to a certain group of users.

I believed some of us need this function. currently it apply to the "All Groups"

 

And from the BO itself, we are not allowed to edit it....

Share this post


Link to post
Share on other sites
  • 4 weeks later...

I installed this module in Prestashop 1.3.7 and it messed up with all the rest of the modules that work somehow with Javascript; in the categories menu block the accordion stopped working, captcha doesn't work any more, Image displayer is blocked in the first picture, I can't delete individual products from Cart, etc.... As my programming skills are very limited I'll have to spend 116 eu. on a pro programmer in order to fix all this mess,I feel so sorry that I someday crossed my life with this module.

Share this post


Link to post
Share on other sites

Hi,

 

Sorry to hear that you had problems but we find it hard to believe that it somehow could be linked to the module as the module is only having an impact on the back office, it is creating a tab in the Back Office and the code associated to that tab is modifying the price reduction of the products as it would be done in the product edit page in the BO while all the problems you report are occuring in the Front Office and seem to be javascript related (there is no javascript whatsoever in the module).

 

Furthermore there is more than 500 downloads of the module and such a problem was never reported.

 

Finally had you contacted us before contacting the "pro programmer" we could eventually have helped you to see what was causing all the trouble (even if it is most likely unrelated to the module as explained above)

 

Best regards,

 

BTConsulting

Share this post


Link to post
Share on other sites

If this module was terrible, 500 persons that downloaded it before would come to this page and argue abou it, that's not the case, so sure your module is good, My experience installing it was not the best one, because after doing the install the whole of my Javascript Folder had disappeared, Things of destination, Murphy's Law, Filezilla Weirdness Hidden Secrets, I don't know, the fact is that I don't wake up in the morning and say to myself "ok, today I am bored so I am going to erase my Javascript Folder" I was in the bad place in a bad time when I installed this module, I'll give You the benefit of the doubt, Sorry if I've been too "straight to the point" with You in last messages.

Share this post


Link to post
Share on other sites
  • 2 weeks later...
  • 3 weeks later...

Hi. I modified your module to work on manufacturer instead of category.

 

You can use this for better visualization:

 

$htmlMan = '<select name="categories" id="categories">';
$manufacturers = Manufacturer::getManufacturers(false, $cookie->id_lang);
foreach($manufacturers as $manufacturer)
 $htmlMan .= '<option value="'.$manufacturer['id_manufacturer'].'">'.$manufacturer['name'].'</option>';
$htmlMan .= '</select>';
echo $htmlMan;

 

instead of:

<input type="text" style="width: 30px;" value="" name="categories" id="categories">

  • Like 1

Share this post


Link to post
Share on other sites
  • 3 weeks later...
  • 2 months later...

I tried both modules but I am getting Access Denied error when I click on the "Sale catagory" link in BO Catalog tab. Any suggestions? I am using 1.4.8.2 version.

Share this post


Link to post
Share on other sites

this mod will save me many many hours of time.

I wanted to post up because i looked threw the code and thought i would post up this up if someone wants it to react the way i wanted it too.

 

comment out this. at around 216 // SpecificPrice::deleteByProductId($id_product);

 

Then at 135 before the </fieldset> tag add this

 

   	 <label>'.$this->l('Quantity:').' </label>
		   	 <div class="margin-form">
			   	 <input type="text" name="sp_from_quantity" value="0" size="11" />

			   	 '.$this->l('(enter the quantity of items for discount here)').'
		   	 </div>		

 

now you can add multiple price tiers.

 

btc.dev i want to thank you again.

 

Can you please also specify the files where to change the code ? I'm having exact the same problem. I had quantity discounts on there before I set a category sale and all these discounts were deleted. This ist not good.... I want to have: sale discount for the category for a specific time and when this time is reached, so again the set quantity discounts should apply. The module is deleting them ?

 

Any fix on this ?

Share this post


Link to post
Share on other sites

I found the file, made the changes, but nothing happened. After adding a category sale all specific prices set befor for quantity discounts were deleted. :(:angry:

 

EDIT: I got it. Your instruction is not complete. You must uncomment THE WHOLE BLOCK around line 216 not only the line 216, than it works...

Share this post


Link to post
Share on other sites
  • 3 weeks later...

Hello and thanks for the module. I just need a little help. I use the sale manufacturer module with no problems and have been using it for a few months. However, I seem to be having a similar problem to that of cd2500. I have the 'on sale' badge but the prices aren't updating. The sale price only shows when the product is added to the cart. I have looked through all the code and compared with the sale manufacturer module but I can't see anything different. Any help would be greatly appreciated!

Share this post


Link to post
Share on other sites
  • 1 month later...
  • 2 weeks later...
  • 1 month later...
  • 2 weeks later...
  • 2 weeks later...

Just tried this module and like the ease of use but since I have groups of users I would still have to edit each item in the specific price tab and select the group for which the discount is to be applied.

If groups could be added I would actually use this module but at present I might as well just do them one by one.

Share this post


Link to post
Share on other sites

Hi Rumba,

 

Yes this module does work with 1.4.8.2

 

Regards,

 

BTC

 

 

hi btc, does the latest v1.4* version also include the fix from cd2500 above, see http://www.prestashop.com/forums/index.php?/topic/144646-module-sale-category-apply-a-reduction-on-sale-status-to-all-the-products-of-a-category/page__view__findpost__p__861978? wondering because it would be great if I could revert back to the previous discount after the category sale ends.

 

also, are there any plans to combine this if possible with the salemanufacturer module?

 

thanks

phil

Share this post


Link to post
Share on other sites
  • 2 weeks later...
  • 2 weeks later...

hello,

maybe someone could help me. i use this module from month with sucess. last week i changed database prefix because it's been 3 years that i used ps. it was not really secure.

 

and today i tried to change prices with the module, it says that table psxx_specific_price doesn't exist.

 

i tried to uninstall an install again, i tried to change chmod, it doesn't work.

 

i tried to change directly the prefix in AdminSaleCategory.php and it worked but this is not the answer. (i have another shop with a prefix wich is not ps_ and the module works fine.)

 

i'm sure i forgot to change somethig somewhere but i don't know what.

could someone help please?

Share this post


Link to post
Share on other sites
  • 3 weeks later...
  • 2 weeks later...

Great! This is exactly what I was looking for.

Unfortunately, I cannot select a category, I have a small white box, no drop out. :-(

I have 1.5.3, so perhaps it is not working for this version?

Share this post


Link to post
Share on other sites

Hi,

 

We did not test it yet on 1.5.3 so it might be possible that there are some issues, we'll test it and see if we can reproduce your problem.

 

Regards,

 

BTConsulting

  • Like 1

Share this post


Link to post
Share on other sites
  • 2 weeks later...

Hello guys,

 

I have a small question regarding this module, what I want is to apply a discount (eg 10% discount on all products since 15/02/2013 to 28/02/2013) without having to apply this reduction in each product manually.

 

This module allows you to do this operation?

 

I'm using PrestaShop 1.4.8.2

Share this post


Link to post
Share on other sites
  • 2 months later...
  • 1 month later...
  • 2 weeks later...

Hello, I have prestashop 1.2.5 and have installed your 125 version. However when I try to apply a discount I get the following message: Hack attempt (Product -> reduction_from = 2013-06-27 9:14:32). Any ideas to what is causing this? Thanks

Share this post


Link to post
Share on other sites

Hi, after looking at the code and banging my head against the wall, I realized I was stupidly selecting reduction AND on sale before updating! I unchecked reduction and it works fine now. Thanks!

Share this post


Link to post
Share on other sites
  • 4 weeks later...

would it be possible to add option to let it give reductions to items from specific price ?

example reductions to items with prices 100$ and above.

or dont give reductions to items with prices 100$ and above.

Share this post


Link to post
Share on other sites
  • 1 month later...
  • 2 weeks later...
  • 1 month later...

Hi,

 

I have one issue. I have this error message when I want to apply sale to a category:

[PrestaShopException]

Property Product->link_rewrite is empty
at line 872 in file classes/ObjectModel.php

866. 
867. 				$message = $this->validateField($field, $value, $id_lang);
868. 				if ($message !== true)
869. 				{
870. 					if ($die)
871. 						throw new PrestaShopException($message);
872. 					return $error_return ? $message : false;
873. 				}
874. 			}
875. 		}
876. 

    ObjectModelCore->validateFieldsLang - [line 660 - classes/Product.php] - [2 Arguments]
    ProductCore->validateFieldsLang - [line 305 - classes/ObjectModel.php] - [0 Argument]
    ObjectModelCore->getFieldsLang - [line 637 - classes/ObjectModel.php] - [0 Argument]
    ObjectModelCore->update - [line 492 - classes/Product.php] - [1 Arguments]
    ProductCore->update - [line 153 - modules/salecategory/controllers/admin/AdminSaleCategoryController.php] - [0 Argument]
    AdminSaleCategoryController->_processSetCategoryRecurse - [line 75 - modules/salecategory/controllers/admin/AdminSaleCategoryController.php] - [2 Arguments]
    AdminSaleCategoryController->processApplySaleCategory - [line 541 - classes/controller/AdminController.php] - [0 Argument]
    AdminControllerCore->postProcess - [line 158 - classes/controller/Controller.php] - [0 Argument]
    ControllerCore->run - [line 348 - classes/Dispatcher.php] - [0 Argument]
    DispatcherCore->dispatch - [line 50 - admin2k13/index.php] - [0 Argument]

All my others categories are working fine with SaleCategory...

Share this post


Link to post
Share on other sites
  • 2 weeks later...

Hello Hakunamatata,

 

As the error indicates the issue is that one (or more) product of that category has not been properly defined as the field link_rewrite is empty.

So you should go over the products of that category to find that/those products and adjust them.

 

Best regards,

 

BTConsulting

Share this post


Link to post
Share on other sites
  • 1 month later...
  • 4 months later...
  • 5 months later...

Hello,

I'm using 1.4.7.0 and now I recognized, that the reduction the customers get, is not showing up in the stats. Will say:

someone buys something for 10€ with reduction of 10% the price he has to pay is 9€. The statistic says: I made 10€ !!!

This is quite terrible, because I use the statistic to pay taxes...

What causes this error and how can I get rid of it ?

 

Please, I really need a solution,

br,

Vivi

Share this post


Link to post
Share on other sites
  • 5 months later...

Hello,

 

Super ton module, très simple et utile.

 

Si tu prévois un changement, il serais bien pouvoir appliquer aussi appliquer les réductions part fabriquant, catégories, produits....

 

A plus

Share this post


Link to post
Share on other sites
  • 6 months later...

Hi, this modue allows me to generate discount for all countries except some country?? 

please reply to me :)

generate discounts for all countries except some
generate discounts for all countries except some
generate discounts for all countries except some
generate discounts for all countries except some
 
generate discounts for all countries except some
 

Share this post


Link to post
Share on other sites
  • 5 months later...
  • 3 months later...
  • nadie unlocked this topic
  • 7 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More