Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Specials in new window


YePix

Recommended Posts

Posted

Hi Guys, what did not I consider? I open some products in an extra window and everything works great. For special offers, however, the window remains empty and the product is not displayed. does anyone have an idea what I did not consider? oscommerce 2.3.4-1 EDGE

Posted

I suppose you need to first tell people what you have done to the code, to be able to open up new windows, before anyone can answer your question.😄

Posted
On 6/17/2019 at 11:41 AM, YePix said:

For special offers,

Make sure you are applying the target-"_blank" to the right bit of code. Specials works fine in new window. You can see it working on the test site

https://chilleddisplays.co.uk

Click the specials in nav-bar and you will see specials open in new window. Code change is,

/public_html/includes/languages/english/modules/navbar_modules/nb_special_offers.php

define('MODULE_NAVBAR_SPECIAL_OFFERS_PUBLIC_TEXT', '<a class="nav-link" href="' . tep_href_link('specials.php') . '" target="_blank"><i class="fa fa-fire"></i> Special Offers</a>');
  

 

It will be difrent for specials box as that already displays on screen, so all you can do is open details in new window. However not sure what the point of that would be?

/public_html/includes/modules/boxes/templates/tpl_bm_specials.php

<div class="card-body text-center">
    <?php echo '<a href="' . tep_href_link('product_info.php', 'products_id=' . (int)$random_product['products_id']) . '" " target="_blank">' . tep_image('images/' . $random_product['products_image'], htmlspecialchars($random_product['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br /><a href="' . tep_href_link('product_info.php', 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br /><del>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</del><br /><span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>'; ?>
  </div>

 

 

Posted

thanks JcMagpie
the new window will open with the following link:

<a href='<?php echo tep_href_link('product_popup.php', 'products_id=' . $printlist['products_id']); ?>', target="_blank" onclick="window.open(this.href,this.target,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=800,height=640,screenX=150,screenY=150,top=5,left=650'); return false;" class="btn btn-success btn-xs" role="button"> <?php echo '<i class="fa fa-shopping-cart"></i>';?></a>


For some reason, data of special offers are not loaded and the window remains empty

Posted
product_popup.php

This is not part of osC so you need to be sure that the file,

1) Has db query for the specials

2) has the the required code to output the query result.

Nothing wrong with html it works fine see your button on test site https://chilleddisplays.co.uk/

It's the code in product_popup.php that is not working. Post the code in the file.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...