Commerce_stock_status module aims to customize "out-of-stock" status for every products on your website. Maybe you want to inform your customers when such products will be available or you just want to set a default "out of stock" status for a specified product type.

Sandbox link => http://drupal.org/sandbox/goldorak/1570672
Drupal Version => 7.X with commerce and commerce_stock enabled

Comments

Avaneesh’s picture

Status: Needs review » Needs work

Hi goldorak,

I could see some Coding standards errors in your project. The list of the errors are here . You can check and verify the errors at the same link .

Also README.txt is missing in the project.
please check the Drupal coding standards.

Regards,
Avaneesh

jkuma’s picture

Status: Needs work » Needs review

Hi Avaneesh,

Thanks for the reply, I've fixed every coding issues and create a 7.x-1.x branch.

Best,
Goldorak

2pha’s picture

I get this error when I tried to enable your module.
PDOException: SQLSTATE[HY000]: General error: 1364 Field 'plugin' doesn't have a default value: INSERT INTO {rules_config} (name, status, module) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => rules_hide_commerce_stock_status_field [:db_insert_placeholder_1] => 2 [:db_insert_placeholder_2] => commerce_stock_status ) in drupal_write_record() (line 7013 of C:\wamp\www\d7\includes\common.inc).

I had a similar error when I tried to enable the stock module without having the cart module enabled first.
Issue is at: http://drupal.org/node/1447210.
It seems that one was because I didn't have the cart module enabled and the stock module didn't have it as a dependency.

I'm not sure if the problem I had enabling the stock module caused the problems I had with your module.

AngryWookie’s picture

Status: Needs review » Needs work

I can confirm that I too am getting an error when trying to rebuild the cache after installing this module. I do have the cart module enabled. Below is the error I'm receiving

PDOException: SQLSTATE[HY000]: General error: 1364 Field 'plugin' doesn't have a default value: INSERT INTO {rules_config} (name, status, module) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => rules_hide_commerce_stock_status_field [:db_insert_placeholder_1] => 2 [:db_insert_placeholder_2] => commerce_stock_status ) in drupal_write_record() (line 7013of /Applications/MAMP/htdocs/alpha3/includes/common.inc).

jkuma’s picture

H 2pha and AngryWookie,

Thanks for the replies guys,

Yes one rule causes an issue when you didn't have commerce_cart module enabled. Indeed, my rule uses "commerce_stock_check_add_to_cart_form_state" action provide by commerce_cart module. So, i'll add commerce_cart into the commerce_stock_status dependencies and try it into a vanilla drupal 7. If everything is ok, i'll commit a new patch afterwards.

Thanks again to taking time to review this module,

Best

AngryWookie’s picture

Please note, I actually did have commerce_cart enabled when I was receiving my error.

jkuma’s picture

Status: Needs work » Needs review

Ok, but it's only a part of the problem.

I've updated the Installation/Requirements section of commerce_stock_status documentation.
Please, Please follow carefully these installation steps.

Unfortunately, I can't set a requirement into the .info file in order to get the version 2 of commerce_stock, it's still in alpha.

dSero’s picture

Hi,

Very nice module that probably needed by many.
The automatic check was absolutely fine.

You may consider these minor upgrades:
1. The README file format seems to be non standard and not according to existing examples.
2. Install file: do you absolutely do nothing during installation?
3. At commerce_stock_status_field_update_default_value() due to security reason (and in order to save CPU), first perform negative check with || and return and after that do the logic:
if (empty($default_value) || empty($instance['default_value'])) {
return;
}
4. Is commerce_stock_status_create_instance redundant? Since I saw no one actually calls it.

P.S I recommend you to perform peer review to receive the review bonus

Best
Moshe

dSero’s picture

Status: Needs review » Needs work

Change the status

klausi’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. Feel free to reopen if you are still working on this application.

klausi’s picture

Status: Closed (won't fix) » Closed (duplicate)
Multiple Applications
It appears that there have been multiple project applications opened under your username:

Project 1: #1827908: [D7] Commerce RMA
Project 2: #1720336: Commerce Stock Status

As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).

If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.

avpaderno’s picture

Issue summary: View changes
Related issues: +#1827908: [D7] Commerce RMA