Jump to content

[FREE MODULE] Out Of Stock Combination Change (PS 1.6 & PS 1.7)


Recommended Posts

Tired of having misleading stock messages when the default combination is out of stock and other combinations are in stock?

With this module, you never have to worry about a product showing out of stock when other combinations are available!

When installed, the module will check all the products with combinations, and if the default combination is out of stock, the module will change the default combination to a similar combination that's in stock (giving priority to combinations with the same price impact).

Whenever a new order is placed, the module will check the stock of the default combination for all the products that were purchased, and adjust the default combination if it's out of stock.

The module does not have a configuration page, it will automatically run on install and when orders are placed.

Direct Download at https://www.presto-changeo.com/home/154-out-of-stock-combination-change.html

ooscc1.jpg

ooscc2.jpg

ooscc3.jpg

  • Like 1
  • Thanks 1

Share this post


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

Thank you. This should be fixed at next PS version. For me is a bug. I use to adjust the default combination manually every time one of the combinations are sold out cos it shows all combinations out of stock. Or more precise user can not change other than the default combination if the default is sold out.

Share this post


Link to post
Share on other sites
3 hours ago, DanielaPetkova said:

Thank you. This should be fixed at next PS version. For me is a bug. I use to adjust the default combination manually every time one of the combinations are sold out cos it shows all combinations out of stock. Or more precise user can not change other than the default combination if the default is sold out.

You're welcome! It is a much needed feature, which is why we made it a free module.

  • Like 1

Share this post


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

Please is it possible to run cron? I need to run this every 10 minutes, because i am importing quantities every 10 minutes. Thanks !

 

/edit: i have solved it by myself, i added cron  :) Thanks for your module btw

Edited by Kaper (see edit history)

Share this post


Link to post
Share on other sites
On 4/12/2020 at 12:23 AM, Kaper said:

Please is it possible to run cron? I need to run this every 10 minutes, because i am importing quantities every 10 minutes. Thanks !

 

/edit: i have solved it by myself, i added cron  :) Thanks for your module btw

Glad to hear you figured it out, and you're welcome! 

Share this post


Link to post
Share on other sites

Thanks, it seems like it's doing it's job. I only noticed strange message in back-end at Modules:

Out Of Stock Combination Change: No currency has been set for this module.

If I click it, I see this:

 

[PrestaShopException]

Method of module cannot be found
at line 802 in file controllers/admin/AdminModulesController.php

796. $echo = '';

797. if ($key != 'update' && $key != 'checkAndUpdate')

798. {

799. // We check if method of module exists

800. if (!method_exists($module, $method))

801. throw new PrestaShopException('Method of module cannot be found');

802.

803. // Get the return value of current method

804. $echo = $module->{$method}();

805.

806. // After a successful install of a single module that has a configuration method, to the configuration page

AdminModulesControllerCore->postProcessCallback - [line 1045 - controllers/admin/AdminModulesController.php]

AdminModulesControllerCore->postProcess - [line 171 - classes/controller/Controller.php]

ControllerCore->run - [line 373 - classes/Dispatcher.php]

 

I don't experience any harm, just noted..

DispatcherCore->dispatch - [line 54 - admin/index.php]

  • Thanks 1

Share this post


Link to post
Share on other sites
4 hours ago, DariusG said:

Thanks, it seems like it's doing it's job. I only noticed strange message in back-end at Modules:

Out Of Stock Combination Change: No currency has been set for this module.

If I click it, I see this:

 

[PrestaShopException]

Method of module cannot be found
at line 802 in file controllers/admin/AdminModulesController.php

796. $echo = '';

797. if ($key != 'update' && $key != 'checkAndUpdate')

798. {

799. // We check if method of module exists

800. if (!method_exists($module, $method))

801. throw new PrestaShopException('Method of module cannot be found');

802.

803. // Get the return value of current method

804. $echo = $module->{$method}();

805.

806. // After a successful install of a single module that has a configuration method, to the configuration page

AdminModulesControllerCore->postProcessCallback - [line 1045 - controllers/admin/AdminModulesController.php]

AdminModulesControllerCore->postProcess - [line 171 - classes/controller/Controller.php]

ControllerCore->run - [line 373 - classes/Dispatcher.php]

 

I don't experience any harm, just noted..

DispatcherCore->dispatch - [line 54 - admin/index.php]

Thanks for letting us know, which PS version are you using?

  • Thanks 1

Share this post


Link to post
Share on other sites

btw - question - does that module run only when somebody buys an item (i.e. it checks if this wasn't a default combination and it's not out of stock now)? Can it run on all products? i.e. if I have few products with default combination and amount =0, can it run thru all products once and change default combinations to existing ones?

I feel like it's not doing it, as I found one product with combination being still default despite 0 items...

Thnx,

Darius

Share this post


Link to post
Share on other sites
17 hours ago, Kaper said:

That´s why i was asking for a cron. Because module itself checks products only if you install module or customer made an order.

Maybe a stupid idea - would pressing Reset the module do the same job as cron?

And how did you create a cron job for it? (I'm total dummy here - no experience). Frankly I don't even know how to run cron jobs :)

 

 

Share this post


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

Dear all,

I don't see that they use currency variable in their code.

Therefore I did de-activate this part assume that they used it for non-free add-ons.

        $this->name = 'ooscombinationchange';
        $this->tab = 'payments_gateways';
        $this->version = '1.0.0';

        $this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
        $this->author = 'Presto-changeo';

        $this->bootstrap = true;
        parent::__construct();

        $this->refreshProperties();

        $this->displayName = $this->l('Out Of Stock Combination Change');
        $this->description = $this->l('Automatically changes the default combination for a product when it goes out of stock');

        /*if (!count(Currency::checkPaymentCurrencies($this->id))) {
            $this->warning = $this->l('No currency has been set for this module.');
        }*/

Kindly,

Share this post


Link to post
Share on other sites

Thank you for bringing this to our attention!
The module has nothing to do with currencies, and this message can safely be ignored.
We will address the warning in a future release of the module.

  • Like 1

Share this post


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

Bonjour, on utilise le module Changement de combinaison en rupture de stock il est super ! cependant on a remarque que quand un produit a une seule couleur et plusieurs taille il n'affiche pas la taille qui n'est pas en rupture de stock dès qu'on arrive sur le produit? Auriez vous une correction que nous pourrions appliquer.Je vous ai mis l'url d'un produit qui pose ce bug.https://hkboutik.fr/accueil/2265-8368-jeans-bleu-boutons-victoire.html#/14-couleur-bleu/34-taille-40Merci de votre retour.

Share this post


Link to post
Share on other sites
On 3/6/2021 at 11:19 AM, kate66 said:

Bonjour, on utilise le module Changement de combinaison en rupture de stock il est super ! cependant on a remarque que quand un produit a une seule couleur et plusieurs taille il n'affiche pas la taille qui n'est pas en rupture de stock dès qu'on arrive sur le produit? Auriez vous une correction que nous pourrions appliquer.Je vous ai mis l'url d'un produit qui pose ce bug.https://hkboutik.fr/accueil/2265-8368-jeans-bleu-boutons-victoire.html#/14-couleur-bleu/34-taille-40Merci de votre retour.

Hi,

I do not speak French, and automated translations can be confusing.
I'll be happy to answer if you write in English.

Thanks!

Share this post


Link to post
Share on other sites

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