Notify me when the product's information, price and stock level is changed
Notify me when the product's information, price and stock level is changed
You can see this in action at http://www.theshisha.com/shopcart/product.php?productid=16139&cat=0&page=1 This modification is for x-cart 4.1.3 version I have posted this modification so that x-cart forum members can contribute to the code and hopefully make any improvements to the modification and post them in this thread. Now about the modification: CUSTOMER: 1. When customer is on "Product Details" page, s/he will see a new form: ------ Notify my when the product's information is changed: < "Enter the email here..." text field > <"Submit" button> ------ The form will look similar for both logged and not logged customer. The only exception will be that the email from the user' profile will be pre-filled in the text-field, however, can be changed to another address, if needed. 2. After clicking "Submit", the script will create a special record in the database, containing the productID, current description, price, quantity in stock and specified email address (a new table will be created for this purpose). ADMIN: When changing the product details (submitting "Product Modify" form, or using "Products import" facility), the script will look if there are any email addresses, associated with the current productID. If yes, it will look for the differences in one of the following fields: - Short/Long description; - Price; - Quantity in stock (from 0 to a bigger value). I.e., it will compare the date, was stored when customer submitted a new form and the currently submitted by the admin data. If any of described changes have taken place, a special "Product information has changed" email will be sent to all the email addresses, associated with current product. The email will contain the text, saying that the information about the product has changed (language variable, which the admin can change in "Languages" section) and the link to "Product Details" page. updated product's information. Also, the information, saved about the product initially (in new table) will be updated with the new product's information (will allow to catch the next changes for the product). Also with the email your customer receives, you have the option to unsubscribe to the product notify me. This modification requires five original xcart 4.1.3 files to be changed: init.php product.php include/import_products.php include/product_modify.php skin1/customer/main/product.tpl Four new x-cart files changed_product_notify.php skin1/mail/productinfo_has_changed.tpl skin1/mail/productinfo_has_changed_subj.tpl skin1/mail/html/productinfo_has_changed.tpl And a change to the SQL file which is below. Apply the SQL changes (Open the Patch/Upgrade page in admin area and select the patch.sql from the archive for the "Apply SQL patch" section). Code:
Upload the Four new x-cart files changed_product_notify.php - This new file goes in the root of your x-cart, same area as where the home.php file is. Code:
skin1/mail/productinfo_has_changed.tpl Code:
skin1/mail/productinfo_has_changed_subj.tpl Code:
{config_load file="$skin_config"}{ $config.Company.company_name }: {$lng.eml_productinfo_has_changed_subj} skin1/mail/html/productinfo_has_changed.tpl Code:
|
Re: Notify me when the product's information, price and stock level is changed
Now to the five original xcart 4.1.3 files to be changed:
include/import_products.php Look for this code: Code:
# Direct import replace it with: Code:
Then look for this code in the same file include/import_products.php : Code:
# Import price And replace it with: Code:
|
Re: Notify me when the product's information, price and stock level is changed
include/product_modify.php
Find this code: Code:
and replace it with: Code:
In the same file include/product_modify.php look for: Code:
and replace it with: Code:
In the same file include/product_modify.php look for: Code:
and replace it with: Code:
|
Re: Notify me when the product's information, price and stock level is changed
You need to change the init.php file
Look for this code: Code:
"download_keys" => "xcart_download_keys", and replace it with: Code:
Now open up your product.php and look for: Code:
and replace it with: Code:
OK, last file now, you need to edit skin1/customer/main/product.tpl and place this code in the file. Code:
{capture name=dialog} I would recommend you place this just under your product description, i placed it after the below code: Code:
{if $active_modules.Magnifier ne "" && ($config.Magnifier.magnifier_image_popup ne 'Y' || $js_enabled ne 'Y')} Thats it the full modification for x-cart 4.1.3, enjoy. |
Re: Notify me when the product's information, price and stock level is changed
Hi Shisha,
Do you think that this mod can work on a 4.0.18 version ? I saw that the original mod by Mallromania. And one day, it seemed to me that I saw it on your old site (4.0.18). Thanks in advance Erick |
Re: Notify me when the product's information, price and stock level is changed
Just cart get this working for some reason any ideas ?
CREATE TABLE x cart_email_for_changed_products Comes up with some errors |
Re: Notify me when the product's information, price and stock level is changed
What errors ?
Here is the code in my daily CRON mysql backup: Code:
Just add this into your mysql patch in admin area: Code:
|
Re: Notify me when the product's information, price and stock level is changed
Quote:
No this is for 4.1.3, i really don't think it will work on 4.0.18 and i have not tried it on this version either, and i would imagine you will have to make some code changes for 4.0.18. This mod has nothing to do with Mallromania ( 4.0.18 Price change thread - http://forum.x-cart.com/showthread.php?t=22781 ), if anything it was born via the Funkydunks code (Notify Me - http://forum.x-cart.com/showthread.php?t=2471&page=5&highlight=notify ) which i adapted for 4.0.?? and then changed it for xcart 4.1.? to also include description and price changes as well as zero stock change. |
Re: Notify me when the product's information, price and stock level is changed
Thank you very much for this nice mod
I installed it in my shop and everything went OK, but there is one big problem When a customer types their email in the box and clicks "submit" they get this error message Access denied ! You are not allowed to access that resource! Error ID: 33 any idea what is wrong? thank you in advance for your help |
Re: Notify me when the product's information, price and stock level is changed
Hi All;
i use X-cart PRO 4.1.6. & i'm a newbie Is there no easyer way?? just that costumers can send a mail when its out of stock ?? like this <Out of stock> notify me when it's back in stock Thx in advance |
Re: Notify me when the product's information, price and stock level is changed
Thank you ShishaPipeUK for posting this wonderful mod.
In case anybody else is interested in this, I got it installed on 4.1.8. There were a few problems: 1. I had to manually insert some of the records in the database (I don't know why it didn't work from the Patch section in X-Cart). 2. in product_modify.php, I had to replace: Code:
x_load('backoffice','category','image','product'); with: Code:
x_load('backoffice','category','image','product','mail'); 3. Maybe this was related to my custom theme, but I had to remove: Code:
<input type="hidden" name="desc" value="{$product.descr}"> from product.tpl, as the description was displaying 2 times on the product page. That's it :) Thanks again. |
Re: Notify me when the product's information, price and stock level is changed
Works OK on 4.1.9 as well, just some minor changes in the standard code but you can easy follow the instructions and find where to place the code.
You can see an example at http://www.shishapipe.net/shopcart/product.php?productid=16594&cat=296&page=1 This site uses menu tabs so I did not edit the skin1/customer/main/product.tpl code, but instead entered this into the tab code for my site. I followed my own instructions for 4.1.3 and found there where no code changes for 4.1.9 but just a few changes in the look for code, but you can easy find the area the code needs to be placed without problems. |
Re: Notify me when the product's information, price and stock level is changed
This mod sounds great! does the site owner also recieve a notification of which product is "requested"?
|
Re: Notify me when the product's information, price and stock level is changed
No that's not been implemented as when you add the stock back in it automatically emails the people who requested the stock notify, but does not email the admin, sorry.
Also the admin does not know who has requested the stock notify unless you look in the mysql data (xcart_email_for_changed_products), i did not make a back end admin section to look at what emails have requested the change in the product stock or details or price. The table in the mysql you need to look for that stores the email and product details is: Code:
Here is an example of one of the entrys: HTML Code:
And when you edit the product in admin, either the descr (Description), fulldescr (Full Description), price (The Price) or avail (Stock level from 0 to a greater number) a email will be sent out automatically. It would not be hard to make a back end admin section to view the emails and products that have been requested for by email address (Look at the wish list code - php and tpl), but i just don't have the time to do this yet, sorry. |
Re: Notify me when the product's information, price and stock level is changed
Not sure what I’m doing wrong but when I’m trying to unsubscribe getting an error message
“Notice: Undefined variable: mode in /var/www/vhosts/httpdocs/changed_product_notify.php on line 2 Notice: Undefined variable: mode in /var/www/vhosts/httpdocs/changed_product_notify.php on line 8 Notice: Undefined variable: login in /var/www/vhosts/httpdocs/changed_product_notify.php on line 16” Is anybody know how to fix it. Many thanks |
Re: Notify me when the product's information, price and stock level is changed
Works on 4.1.10. I had to manually put in the dif. patching wouldn't work for some unknown reason. We've had this issue with other mods in 4.1.10 too so it may be a bug/change/error with the 4.1.10 patching system?
Either way, nice mod. |
Re: Notify me when the product's information, price and stock level is changed
Thanks a lot for a great mod. Is anybody know how I can add a Confirmation Page (something like: “Thank you for submitting your email....”) and if email address is empty or doesn’t contained @ or . – page saying “Please get back and correct it...”.
Many thanks |
Re: Notify me when the product's information, price and stock level is changed
ShishaPipeUK,
This would be useful for a site i'm working on, but i have a question about it. Because I have a high volume of products to alter when i do an update, too many for x-cart product imports, I insert product details directly into the mySQL database in bulk instead. Would the mod work in this instance or will it only work if an x-cart induced product import is done? Thanks in advance, |
Re: Notify me when the product's information, price and stock level is changed
This is a great mod. Thanks for sharing.
I consider useful as a visitor only the following notifications: - if the price decreases - back in stock (initial stock 0 - out of stock, if it is changed to positive values - in stock) |
Re: Notify me when the product's information, price and stock level is changed
I would like to ask if this mods allows to unsubscribe. Let's say I am an anonymous visitor and I would like to be informed about price decrease using this feature.
|
Re: Notify me when the product's information, price and stock level is changed
Has anyone tested this on XC 4.4.4?
|
Re: Notify me when the product's information, price and stock level is changed
Has anyone for 4.4.2 Pro??
|
All times are GMT -8. The time now is 11:18 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.