Will there be a D7 port for this module?
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | uc_stock_notify.zip | 15.06 KB | mr_byte |
| #8 | uc_stock_notify.zip | 10.55 KB | suncombo |
| #6 | uc_stock_notify.zip | 10.5 KB | suncombo |
| #4 | uc_stock_notify.zip | 10.57 KB | suncombo |
| #1 | uc_stock_notify.zip | 10.52 KB | suncombo |
Comments
Comment #1
suncombo commentedI try to update modules for the first time. Want to help you.
Comment #2
Quarantine commentedThank you so much for this suncombo! I'll give this a shot and will report back if I've any issues. :)
Comment #3
Quarantine commentedHey suncombo,
I installed this module on my site, then went to Edit a product, clicked on "Stock", and under "Active", I made a mark on its checkbox.
After I saved the changes, these error messages immediately appeared:
Would you know what would be the problem?
Comment #4
suncombo commentedI update the module,Please try it.
Comment #5
Quarantine commentedThank you so much again for your effort suncombo!
I just tried it again, and this time, using the same exact steps that I described above, this error code is appearing again:
But this time it's on a different line.
At the product itself, these error messages are appearing:
Comment #6
suncombo commentedI have the same problem, I uploaded an updated version, please forgive me I was a rookie.
Comment #7
Quarantine commentedHey suncombo,
Don't worry, I'm an even worse rookie. :P But thanks again for all your effort in this.
I think it worked fine now! Just one more error message that I spotted. Here's what I did:
1. Change stock level of a product to 0, and make it "active".
2. Go to "View" for the product, and click on the button for "Notify me when this product is in stock".
3. Change the stock level of that product to 3 (any value other than 0).
4. Then immediately this error message appears:
Notice: Undefined index: message in uc_order_mail() (line 564 of /var/www/URL.com/sites/all/modules/ubercart/uc_order/uc_order.module).Actually, where do I go to edit the message for the e-mail to be sent?
The e-mail I received in the inbox has this exact title: "[store-name]: [title] back in stock" and the body of the e-mail is blank/empty.
Comment #8
suncombo commentedI have had this problem, I uploaded the new updates.
Please test again.
Comment #9
Allthegearnoidea commentedThis is actually a really useful module... How do you make it an official release?
Comment #10
Allthegearnoidea commentedJust been playing with this a bit... I notice that the email that comes through.
Mostly it's great and it's definitely a great marketing tool for any store.
The issue I am having is that the email it sends out has the website's URL included in it. So it will display example.com However if you click on the URL generated the email client tries to follow [store:url] rather than the actual url shown (if you hover over the URL generated you will see (in Outlook) that it says " [store:url] click to follow link " whereas you'd expect it to say " example.com click to follow link ". This leads (certainly in Outlook) for a warning to be given "This location may be unsafe: [store:url]"
I've tried to fix this to just remove this part of the email so the store's main URL is not included (as it has the product link working just fine) but (as I am useless with code) I am succeeding only in breaking the module.
Any thoughts on how to overcome the issue above?
Thanks
Comment #11
Allthegearnoidea commentedI solved this in the end... I finally worked out how to remove the [store:url] part and not break the module :-)
Thanks
Comment #12
waltercat commentedI am having the same issue where the email is blank. Does anyone know how to fix this? It is such a useful module.
Comment #13
waltercat commentedWilling to contribute some money to get a D7 Port working up to speed. Thanks!
Comment #14
gukudrupal commentedHi,
I was just playing around with this and finally got it working where I got the emails with the text showing up in the body.
This is the code I used in the uc_stock_notify.module file.:
instead of all this:
No more blank emails.
Hope that helps, as this took me a while to get fixed for our store.
David
Comment #15
mr_byte commentedThere are some issues with module for me, mainly it doesn't work at all with attributes. I also had issues with email tokens not being properly replaced, so I re-wrote a portion of that as well.
What I have so far, is with the help of uc_attribute_stock_filter, made this module a bit more aware of attributes and their options that may contain stock.
It's a work in progress. I will post here once it's to the "works for me" stage and a bit simplified.
Comment #16
mr_byte commentedAs promised, the "it works for me" stage.
It will properly flag items that are out of stock, with no attributes. It will flag items with 1 attribute and all options are out of stock. I assume (but have not tested...) multiple attributes will perform the same way.
The use can select the option they want and hit "notify" and they'll get added to the list.
There is code in there for adding a logged in user to the list if they select an out-of-stock option for an item that still has stock on other options. Maybe someone can find a graceful way to put a message up to let users know this beforehand. It does notify users when they try to add an out-of-stock option to the cart.
This last (and most difficult) case requires a patch to your out of stock module. I use uc_out_of_stock, so the relevant code goes into function uc_out_of_stock_validate_addtocart:
If there's a better way to do this so the out of stock module needs no modification, feel free to share.
As is, it should work without the uc_out_of_stock module, but I have not tested it this way. YMMV.
Comment #17
mr_byte commentedEmbarrasing. I uploaded the wrong file. This one is correct.
Comment #18
BigMike commentedHello fellow Ubercart lovers!
Feel free to skip to (2) below. Sorry for the unnecessarily long post. I'm just excited over here :-D
(1) Background:
We've used D6/UC2 for over 8 yrs (and before that was D5/UC1) and earlier this year we/I finally made the switch to D7/UC3! I knew that, very sad to see, Ubercart support has dwindled due to a former UC team member who left and, as far as I can tell from a complete outsider, has some deep grudge empowering his mission to derail UC with a competing Store module and it just makes me sick. So many new D7 modules appearing for that other system with fewer D7 module support for the entire reason why we made the switch to Drupal nearly a decade ago: Because of the awesome Ubercart module!! So I am an UC fan through-and-through and I hope support from the community (3rd party contrib modules) can continue as we'll be moving to D8/UC4 someday.
Little by little I've been learning more and more about module development and have an ability to get in trouble and also to troubleshoot. As I get better I hope someday to actually be a contributor to Ubercart to help support the cause!!
(2) Couple small updates to mr_byte's #17 post/module
When I was upgrading our UC2 site naturally I looked to install our #1 most important user-contrib module and that is UC Stock Notify. I've messed with both suncombo and mr_byte's ports to D7 and I HAVE to first say THANK YOU to you both for doing this.
I don't know if this is needed for others but I finally got mr_byte's #17 post/module to work on our site. It took me two days and I figured out the following four changes are needed for me. Our site is D7.54, UC3.10, operating over PHP v5.3.x (already in the works on upgrading this). I'm also using AJAX Cart Alternative 1.7+8-dev (2016-Jun-16) and it works with Javascript enabled or disabled in Firefox and IE11 for both authenticated and anonymous users so all seems good!
Using uc_stock_notify_4.zip from post #17 (https://www.drupal.org/files/issues/uc_stock_notify_4.zip)
File: uc_stock_notify.module
[Change 1]
Line 53: Old
if (count($models) == 1) $model = $models[0];New:
if (count($models) == 1) $model = reset($models);[Change 2]
Lines 75-78: Old
New:
[Change 3]
Line 185: Old
$attrs = isset($form_state['values']['attributes']);New:
$attrs = $form_state['values']['attributes'];[Change 4]
Finally, there are a few calls to a function called uc_out_of_stock_getstockinfo() which doesn't exist and is found in the project "Ubercart Out of stock Notification" (https://www.drupal.org/project/uc_out_of_stock). I was previously using this module so fortunately it was easy to figure it out:
1. Download that module (I used v1.1, https://ftp.drupal.org/files/projects/uc_out_of_stock-7.x-1.1.tar.gz)
2. Open 'uc_out_of_stock.module' and copy the function (lines #105-154)
3. Paste the function anywhere to uc_stock_notify.module (I pasted it after the function uc_stock_notify_get_sku() at line 220).
Ok! At this point mr_byte's module began working without errors! Maybe it's just our old PHP version or maybe it's that D7 has been updated since my_byte's code. Nevertheless, if this helps someone then I'm glad I posted up. THANK YOU mr_byte for compatibility with attributes, and have a nice day!
Regards,
BigMike
Comment #19
fox mulder commentedThe sended mail is not translatable because a new translatable string will be created to any product.
Recommended changes from line 306 in uc_stock_notify/uc_stock_notify.module
Comment #20
Mar1ak10 commentedThank you all for taking the time to update this issue, it greatly helped me.
Thanks to BigMike in comment #18 I was able to get rid of an error appearing about undefined something at line 53 of the module, but I have a couple of issues when trying to follow his steps.
1- [Change 3]
Line 185: Old
$attrs = isset($form_state['values']['attributes']);New:
$attrs = $form_state['values']['attributes'];When I got to this step I noticed that the new code he is requesting us to place is actually the code I found in the module, maybe he mixed up the 'Old' and 'New' around?
2- When copying the function from the module uc_out_of_stock.module into this module file I get this error on the site
"Fatal error: Cannot redeclare uc_out_of_stock_getstockinfo() (previously declared in /home/user/public_html/sites/all/modules/uc_out_of_stock/uc_out_of_stock.module:105"
I remember doing a a drupal core update not long ago, definitely after his comment, so maybe it has to do something with that?
Anyway, I did not do anything about what I mentioned in number 1 AKA I left the code as it is and removed the function uc_out_of_stock_getstockinfo() from this module and everything is running fine after testing. Wish if someone could shed some light on these two points.
P.S: The e-mails I've been receiving are never blank so I did not need to modify anything about emails.
Thanks everybody.
Comment #21
mr_byte commentedI know it's been a while. Glad my spaghetti is usable to someone :-) I'm no longer using this module myself, as I switched my system to internal use (POS) only.