Forums / Addon Admin Tools / Ajax Back In Stock (re-written version of Conor/Ceon's Back In Stock Module)

Ajax Back In Stock (re-written version of Conor/Ceon's Back In Stock Module)

Views: 35,770

Results 41 to 60 of 147
26 Mar 2015, 10:59 AM
#41
izar74 avatar

izar74

Zen Follower

Join Date:
Mar 2009
Location:
Italy
Posts:
155
Plugin Contributions:
0

Ajax Back In Stock (re-written version of Conor/Ceon's Back In Stock Module)

I have attached the changes I've made to have the definitions of the Mail,Popup and Account fields so that you can set it in the language file and not in the database, this way You can have the texts in different languages.
Hope it can help:smile:

Attachment #15088

26 Mar 2015, 4:32 PM
#42
bislewl avatar

bislewl

Totally Zenned

Join Date:
Dec 2011
Location:
Wisconsin, USA
Posts:
674
Plugin Contributions:
12

Re: Ajax Back In Stock (re-written version of Conor/Ceon's Back In Stock Module)

It wasn't really intended for the home page...but I will try to fix that in 4.2.2 as well.
Also the "Email me when back in stock" could be replaced with something like <img src="images/SOME_IMAGE"> to be more user friendly for your customers

Also if you have the new language files I would be more than happy, to add them to the modules for others. (if you don't mind of course)

Thanks agian for the bug report!

26 Mar 2015, 5:04 PM
#43
bislewl avatar

bislewl

Totally Zenned

Join Date:
Dec 2011
Location:
Wisconsin, USA
Posts:
674
Plugin Contributions:
12

Re: Ajax Back In Stock (re-written version of Conor/Ceon's Back In Stock Module)

izar74:

I have attached the changes I've made to have the definitions of the Mail,Popup and Account fields so that you can set it in the language file and not in the database, this way You can have the texts in different languages.
Hope it can help:smile:

Attachment #15088

Thanks for the files, I actually skipped 4.2.2 and moved right to 4.3.0. and submitted for moderation. Thanks again!

30 Mar 2015, 8:31 PM
#44
izar74 avatar

izar74

Zen Follower

Join Date:
Mar 2009
Location:
Italy
Posts:
155
Plugin Contributions:
0

Re: Ajax Back In Stock (re-written version of Conor/Ceon's Back In Stock Module)

Hi again,

i've downloaded the new version e still testing It, meanwhile i found a strange problem.
Attachment #15111

The big red arrow indicate what i've found. After a few try I found out that it comes when i modified the footer.php adding:

<!--bof back in stock popup-->
<?php require($template->get_template_dir('tpl_modules_back_in_stock_fancybox.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_back_in_stock_fancybox.php'); ?>
<!--eof back in stock popup-->

So clearly it's a problem related to the loading of the tpl_modules_back_in_stock_fancybox.php (i've tried also on a fresh install,with the same template, and the problem is the same) but till now i wasn't able to figure it out.

The template is the winchester Black, with the default template it desn't show... which file could be involved?

Thnaks for any advice

31 Mar 2015, 9:22 AM
#45
izar74 avatar

izar74

Zen Follower

Join Date:
Mar 2009
Location:
Italy
Posts:
155
Plugin Contributions:
0

Re: Ajax Back In Stock (re-written version of Conor/Ceon's Back In Stock Module)

Ok seem i found out the error in /includes/templates/YOUR_TEMPLATE/tlp_modules_back_in_stock_fancybox.php Line 22 is:

echo '<script type="text/javascript">if (typeof jQuery == \'undefined\') {document.write(\'<script type="text/javascript" src="//code.jquery.com/jquery-1.11.1.min.js"></script>\');}
</script>'."\n";

it seems there ere some characters more than needed -->"');}"
I modified the line as follow:

echo '<script type="text/javascript">if (typeof jQuery == \'undefined\') {document.write(\'<script type="text/javascript" src="//code.jquery.com/jquery-1.11.1.min.js"></script>\</script>'."\n";

Now the problem seems gone, just check it to be sure i didn't make any mistake.

31 Mar 2015, 12:20 PM
#47
izar74 avatar

izar74

Zen Follower

Join Date:
Mar 2009
Location:
Italy
Posts:
155
Plugin Contributions:
0

Re: Ajax Back In Stock (re-written version of Conor/Ceon's Back In Stock Module)

wooops sorry i forgot the closing ")" and "}", here the code i'm using at the moment and it seem to work fine:

echo '<script type="text/javascript">if (typeof jQuery == \'undefined\') {document.write(\'<script type="text/javascript" src="//code.jquery.com/jquery-1.11.1.min.js"></script>\</script>')}."\n";
31 Mar 2015, 1:00 PM
#48
izar74 avatar

izar74

Zen Follower

Join Date:
Mar 2009
Location:
Italy
Posts:
155
Plugin Contributions:
0

Re: Ajax Back In Stock (re-written version of Conor/Ceon's Back In Stock Module)

Discard the upper modification... it generates error. Sorry but I'm not very good at the moment and I'm making mistakes...

Using THIS code:

echo '<script type="text/javascript">if (typeof jQuery == \'undefined\') { document.write(\'<script type="text/javascript" src="//code.jquery.com/jquery-1.11.1.min.js"></script>\</script>'."\n";

It work fine and doesn't generate any error even if it seems to me not to be correct. Waiting for someone with more skill than me to take a look :(

31 Mar 2015, 7:42 PM
#49
izar74 avatar

izar74

Zen Follower

Join Date:
Mar 2009
Location:
Italy
Posts:
155
Plugin Contributions:
0

Re: Ajax Back In Stock (re-written version of Conor/Ceon's Back In Stock Module)

Hi bislewl,

from the tests i did I got the same email problems as before the update (4.3). I saw the code You changed but the email It send when an article is back in stock (starting the cron manually) has no product in the object or in the mail body. :(

1 Apr 2015, 10:35 AM
#50
izar74 avatar

izar74

Zen Follower

Join Date:
Mar 2009
Location:
Italy
Posts:
155
Plugin Contributions:
0

Re: Ajax Back In Stock (re-written version of Conor/Ceon's Back In Stock Module)

Just a note,

The popup works only if You are in the product page, and it's fine, even if you are in the category listing page and try to add a product It won't work.

Established this since the popup work ONLY in the product page, i would like to have in all the other part (cathegory listing, Featured or Special listing, all Product Listing...) a link that bring to the product page instead tha open the popup.

Would it be possible? Should i modified the Function_general.php or all the single file?

12 Apr 2015, 7:32 PM
#51
louis avatar

louis

Zen Follower

Join Date:
Jul 2006
Location:
Johannesburg
Posts:
408
Plugin Contributions:
0

Re: Ajax Back In Stock (re-written version of Conor/Ceon's Back In Stock Module)

Hi, I upgraded to the latest and found the following issue. It seems a whole number of langauge file updates are missing?

BACK_IN_STOCK_MAIL_GREETINGLeon,

BACK_IN_STOCK_MAIL_TOPCelestron TrekGuide (Black)

BACK_IN_STOCK_MAIL_MAIN

Celestron TrekGuide (Black)

http://xxxxxxxxxxxxxxxx/index.php?main_page=product_info&products_id=5412

BACK_IN_STOCK_MAIL_BOTTOM

BACK_IN_STOCK_MAIL_CANCEL
http://xxxxxxxxxxxxxxxx/index.php?main_page=back_in_stock&bis_id=89

Will have to re-install older 4.1.1 version again.

What did you change to get the product name displayed in the mail when the item is BACK in stock? These mails do not show the product name.

12 Apr 2015, 8:06 PM
#52
izar74 avatar

izar74

Zen Follower

Join Date:
Mar 2009
Location:
Italy
Posts:
155
Plugin Contributions:
0

Re: Ajax Back In Stock (re-written version of Conor/Ceon's Back In Stock Module)

Louis:

Hi, I upgraded to the latest and found the following issue. It seems a whole number of langauge file updates are missing?

Will have to re-install older 4.1.1 version again.

What did you change to get the product name displayed in the mail when the item is BACK in stock? These mails do not show the product name.

Hi, there is still a bug so that when something is back in stock the mail would not display the item name, if You want to have the picture yet be sure to use HTML mail not simple text.

As regards the error You are reporting, there are some miss in the language define file, simply go to the language file and add the various define like:

define ('BACK_IN_STOCK_MAIL_GREETING', ' Welcome ');

This should fix it.

19 Apr 2015, 12:34 PM
#53
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Ajax Back In Stock (re-written version of Conor/Ceon's Back In Stock Module)

izar74:

Ok seem i found out the error in /includes/templates/YOUR_TEMPLATE/tlp_modules_back_in_stock_fancybox.php Line 22 is:

echo '<script type="text/javascript">if (typeof jQuery == 'undefined') {document.write('<script type="text/javascript" src="//code.jquery.com/jquery-1.11.1.min.js"></script>');}
</script>'."\n";

> 
> it seems there ere some characters more than needed -->"');}" 
> I modified the line as follow:
> 
> ```php
echo '<script type="text/javascript">if (typeof jQuery == \'undefined\') {document.write(\'<script type="text/javascript" src="//code.jquery.com/jquery-1.11.1.min.js"></script>\</script>'."\n";

Now the problem seems gone, just check it to be sure i didn't make any mistake.
The solution posted leaves behind a stray slash on the page. Should be:

echo '<script type="text/javascript">if (typeof jQuery == \'undefined\') {document.write(\'<script type="text/javascript" src="//code.jquery.com/jquery-1.11.1.min.js"></script></script>'."\n";  

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

19 Apr 2015, 12:44 PM
#54
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Ajax Back In Stock (re-written version of Conor/Ceon's Back In Stock Module)

I do have to say that I second a sentiment expressed by a couple posters that the readme file instructions aren't super clear.. I've figured most of this out, but there is one thing left.. This code didn't work for me..

bislewl:

<?php if(zen_get_products_stock($products_id) > 0){ ?> <!--bof Add to Cart Box-->

the stuff between these

<!--eof Add to Cart Box--> <?php } else{ if(BACK_IN_STOCK_ENABLE == "true"){ ?>

<a href="#back-in-stock-popup-wrapper" id="back-in-stock-popup-link"><?php echo BACK_IN_STOCK_LINK; ?></a>

<?php } } ``` I made the following changes, and now it works as expected. Now the only thing I can't figure out is why this is showing as a text link versus a button.. This did work: ```php <?php if(zen_get_products_stock($products_id) > 0){ ?> <!--bof Add to Cart Box --> <?php if (CUSTOMERS_APPROVAL == 3 and TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM == '') { // do nothing } else { ?>
        <?php
$display_qty = (($flag_show_product_info_in_cart_qty == 1 and $_SESSION['cart']->in_cart($_GET['products_id'])) ? '<p>' . PRODUCTS_ORDER_QTY_TEXT_IN_CART . $_SESSION['cart']->get_quantity($_GET['products_id']) . '</p>' : '');
        if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
          // hide the quantity box and default to 1
          $the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
        } else {
          // show the quantity box
$the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<br />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
        }
$display_button = zen_get_buy_now_button($_GET['products_id'], $the_button);

?>

<?php if ($display_qty != '' or $display_button != '') { ?>
<div id="cartAdd">
<?php
  echo $display_qty;
  echo $display_button;
        ?>
      </div>
<?php } // display qty and button ?> <?php } // CUSTOMERS_APPROVAL == 3 ?> <!--eof Add to Cart Box--> <?php } else{ ?> <?php if(BACK_IN_STOCK_ENABLE == "true"){ ?>

<a href="#back-in-stock-popup-wrapper" id="back-in-stock-popup-link"><?php echo BACK_IN_STOCK_LINK; ?></a>

<?php } ?> <?php } ?>

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

19 Apr 2015, 2:45 PM
#55
perfumbg avatar

perfumbg

Zen Follower

Join Date:
May 2010
Posts:
192
Plugin Contributions:
5

Re: Ajax Back In Stock (re-written version of Conor/Ceon's Back In Stock Module)

Hello, just installed the plugin and it is great but when i try to run notification
the following error apears:

The server can not find the requested page:

site.com/cron/send_back_in_stock_notifications.php?product_id=0&key=8675309&bis_id=0 (port 443)
Please forward this error screen to site's WebMaster.

Any idea what can cause this?
And also what does that mean "File to add to your cron in cpanel:"
Best regrds.

My most recent work: magprom.net

19 Apr 2015, 6:16 PM
#56
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Ajax Back In Stock (re-written version of Conor/Ceon's Back In Stock Module)

perfumbg:

Hello, just installed the plugin and it is great but when i try to run notification
the following error apears:

The server can not find the requested page:

site.com/cron/send_back_in_stock_notifications.php?product_id=0&key=8675309&bis_id=0 (port 443)
Please forward this error screen to site's WebMaster.

Any idea what can cause this?
And also what does that mean "File to add to your cron in cpanel:"
Best regrds.

I'm getting a similar result except in my case I'm being re-directed to the "Page Not Found" page..

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

19 Apr 2015, 6:37 PM
#57
perfumbg avatar

perfumbg

Zen Follower

Join Date:
May 2010
Posts:
192
Plugin Contributions:
5

Re: Ajax Back In Stock (re-written version of Conor/Ceon's Back In Stock Module)

DivaVocals:

I'm getting a similar result except in my case I'm being re-directed to the "Page Not Found" page..

Yes I am redirected to the not found page too.

My most recent work: magprom.net

20 Apr 2015, 6:16 PM
#58
bislewl avatar

bislewl

Totally Zenned

Join Date:
Dec 2011
Location:
Wisconsin, USA
Posts:
674
Plugin Contributions:
12

Re: Ajax Back In Stock (re-written version of Conor/Ceon's Back In Stock Module)

DivaVocals:

I'm getting a similar result except in my case I'm being re-directed to the "Page Not Found" page..

Does this file exist? site.com/cron/send_back_in_stock_notifications.php

Is there a rewrite rule preventing it?

20 Apr 2015, 6:25 PM
#59
bislewl avatar

bislewl

Totally Zenned

Join Date:
Dec 2011
Location:
Wisconsin, USA
Posts:
674
Plugin Contributions:
12

Re: Ajax Back In Stock (re-written version of Conor/Ceon's Back In Stock Module)

DivaVocals:

I do have to say that I second a sentiment expressed by a couple posters that the readme file instructions aren't super clear.. I've figured most of this out, but there is one thing left.. This code didn't work for me..

I made the following changes, and now it works as expected. Now the only thing I can't figure out is why this is showing as a text link versus a button..

This did work:

<?php if(zen_get_products_stock($products_id) > 0){ ?> <!--bof Add to Cart Box --> <?php if (CUSTOMERS_APPROVAL == 3 and TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM == '') { // do nothing } else { ?>
        <?php
$display_qty = (($flag_show_product_info_in_cart_qty == 1 and $_SESSION['cart']->in_cart($_GET['products_id'])) ? '<p>' . PRODUCTS_ORDER_QTY_TEXT_IN_CART . $_SESSION['cart']->get_quantity($_GET['products_id']) . '</p>' : '');
        if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
          // hide the quantity box and default to 1
          $the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
        } else {
          // show the quantity box
$the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<br />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
        }
$display_button = zen_get_buy_now_button($_GET['products_id'], $the_button);

?>

<?php if ($display_qty != '' or $display_button != '') { ?>
<div id="cartAdd">
<?php
  echo $display_qty;
  echo $display_button;
        ?>
      </div>
<?php } // display qty and button ?> <?php } // CUSTOMERS_APPROVAL == 3 ?> <!--eof Add to Cart Box--> <?php } else{ ?> <?php if(BACK_IN_STOCK_ENABLE == "true"){ ?>

<a href="#back-in-stock-popup-wrapper" id="back-in-stock-popup-link"><?php echo BACK_IN_STOCK_LINK; ?></a>

<?php } ?> <?php } ?>

The documentation for this was improved in 4.3.0
20 Apr 2015, 9:25 PM
#60
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Ajax Back In Stock (re-written version of Conor/Ceon's Back In Stock Module)

bislewl:

Does this file exist? site.com/cron/send_back_in_stock_notifications.php

Is there a rewrite rule preventing it?File exists.. No re-write rule blocking it.. It didn't work even before I install Ultimate URLs

bislewl:

The documentation for this was improved in 4.3.0Excellent.. I have more to share about using this module with a stock manager module like POSM or SBA.. (Hint: requires a slightly different set of conditions for the if statements)

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.