Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Automatically click link

1:44 pm on Oct 19, 2012 (gmt 0)

5+ Year Member

I have the below code which shows a stock alert link on out of stock product pages:

if ($block->isShow()): ?>
<p class="alertStock"><a <?php if (!$userLoggedIn): ?> rel="showStockPopupForm" lang="<?php echo $_product->getId() ?>" <?php endif; ?> href="<?php echo $this->escapeHtml($this->getSignupUrl()) ?>"><?php echo $this->__('Sign up to get notified when this product is back in stock'); ?></a></p>
<?php endif; ?>

I would like this link to get triggered automatically. How can I use jQuery to click this link on page load?

10:30 am on Oct 22, 2012 (gmt 0)

something like this should do:

$(window).load(function() {
$(".alertStock a").trigger("click");

Featured Threads

Hot Threads This Week

Hot Threads This Month