Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

X-Sell


YePix

Recommended Posts

I have a question about the X-Sell module.

What needs to be set where, so I'm not redirected to another page when clicking on buy?

In the admin the forwarding is set to false and all pages remain the same, but with X-Sell I am led after the purchase to index.php.

Can someone help here? Thank you
Link to comment
Share on other sites

Just had a quick look at the files and install manual. Not sure if the following is the reason for the wrong redirect since I didn't test it but there is a small typo in Step 14 (application_top.php)

This

$parameters = array('action', 'pid', 'products_to_but_id');

should be

$parameters = array('action', 'pid', 'products_to_buy_id');

The add-on also needs some overhaul to be Edge compatible. All FILENAME_ and DIR_WS_ definitions need to be replaced.

Link to comment
Share on other sites

 

Thanks Tsimi, I have changed the bug but it still does not work. Again and again directed to the index.php

 

**********************************************

functions/cache.php

// Cache the also Xell module
  function tep_cache_xsell_products($auto_expire = false, $refresh = false) {
    global $_GET, $language, $languages_id;

    $cache_output = '';

    if (isset($_GET['products_id']) && is_numeric($_GET['products_id'])) {
      if (($refresh == true) || !read_cache($cache_output, 'xsell_products-' . $language . '.cache' . $_GET['products_id'], $auto_expire)) {
        ob_start();
        include('includes/modules/xsell_products.php');
        $cache_output = ob_get_contents();
        ob_end_clean();
        write_cache($cache_output, 'xsell_products-' . $language . '.cache' . $_GET['products_id']);
      }
    }

    return $cache_output;
  }

includes/application_top.php

    if (DISPLAY_CART == 'true') {
      $goto = 'shopping_cart.php';
      $parameters = array('action', 'cPath', 'products_id', 'pid');
    } else {
      $goto = basename($PHP_SELF);
     	if ($_GET['action'] == 'buy_now') {
// BOE: XSell
        if (isset($_GET['product_to_buy_id'])) {
          $parameters = array('action', 'pid', 'products_to_buy_id');
		} else {
          $parameters = array('action', 'pid', 'products_id');
		}
// EOE: XSell
      } else {
        $parameters = array('action', 'pid');
      }
    }

includes/modules/xsell_products.php

  		  if ((STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true')) {
 			  	$qty = (isset($xsell['products_quantity']) ? $xsell['products_quantity'] : 'x');
			    if (($xsell['products_bundle'] == 'yes') || ($qty == 'x')) $qty = tep_get_products_stock($xsell['products_id']);
			  }
			  if ((STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') && ($qty < 1)) {
            
            	} else {
              if (SHOW_BUTTON_BUY_NOW == 'true') { 
			  $lc_text = '<br><div class="col-xs-12 text-right">' . tep_draw_button(SMALL_IMAGE_BUTTON_VIEW, 'fa fa-eye', tep_href_link('product_info.php', 'products_id=' . $xsell['products_id']), 'btn-success btn-sm') .'&nbsp;'. tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'fa fa-shopping-cart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'products_id')) . 'action=buy_now&products_id=' . $xsell['products_id']), NULL, NULL, 'btn btn-success') . '</div>';
            	}else{
              $lc_text = '<br><div class="col-xs-12 text-center">' . tep_draw_button(SMALL_IMAGE_BUTTON_VIEW, 'fa fa-eye', tep_href_link('product_info.php', 'products_id=' . $xsell['products_id']), 'btn-success btn-sm') . '</div>';
            }}
			  $products_xsell_content .= $lc_text;
      }

 

Link to comment
Share on other sites

@Yepi

I could recreate the redirect problem.

I could not find any solution but looking at another module like "also_purchased" it does not contain any "buy now" or "add to cart" button. In fact I don't recall any module or add-on that adds something to the product_info.php page with a buy button except for the Master Products add-on which is way more complex then this.

I suggest you either remove the buy now button and only keep a view button so that you get redirected to that product page or what I was able to do is a redirect to the product page of the product you just added to the cart.

Check here

and add this new action into the application_top.php file (catalog side)

Check here

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...