Jump to content
Küchenchef

X-Sell

Recommended Posts

Ich habe eine Frage zum X-Sell Modul.

Was muss wo eingestellt werden, damit ich beim Klick auf Kaufen nicht auf eine andere Seite weitergeleitet werde ?

Im Admin ist die Weiterleitung auf false gestellt und alle Seiten bleiben gleich, doch bei X-Sell werde ich nach dem Kauf zu index.php geleitet.

Kann hier jemand etwas Hilfe leisten ? Danke

Share this post


Link to post
Share on other sites

Normalerweise wird bei Klick auf das X-Sell Produkt zum Produkt geleitet, bzw. bei "In den Warenkorb" zum Warenkorb geleitet.

Ein X-Sell Produkt ist ein ganz normales Produkt, somit sollte es keinen Unterschied nach dem Kauf geben. Poste mal Deine X-Sell Datei.

Möglicherweise wird auch eine nicht vorhandene Seite aufgerufen und durch Einstellungen in der htaccess zur index.php weitergeleitet.


  • The clever one learn from everything and from everybody
  • The normal one learn from his experience
  • The silly one knows everything better

[socrates, 412 before Christ]

Computers help us with the problems we wouldn't have without them!
99.9% of the bugs sit in front of the computer!
My programmed add-ons: WDW EasyTabs 1.0.3, WDW Facebook Like 1.0.0

if(isset($this) || !isset($this)){ // that's the question...

 

Share this post


Link to post
Share on other sites
On ‎12‎.‎04‎.‎2018 at 14:59, Küchenchef said:

... Klick auf Kaufen nicht auf eine andere Seite weitergeleitet werde ?

Wie sieht der generierte Link aus? Kannst Du uns den bitte verraten?

Share this post


Link to post
Share on other sites

Hallo Ingo & Manfred,

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');
      }
    }

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

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;
      }

Share this post


Link to post
Share on other sites

die ganze x-sell

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

<?php
/*
  $Id$

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2010 osCommerce

  Released under the GNU General Public License
*/

if ((USE_CACHE == 'true') && empty($SID)) {
	require('includes/classes/currencies.php');
	$currencies = new currencies();
}

if (isset($_GET['products_id'])) {
  $xsell_query = tep_db_query("select p.products_id, p.products_quantity, p.products_image, pd.products_name, p.products_tax_class_id, p.products_price, pd.products_description, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price	from " . TABLE_PRODUCTS_XSELL . " xp left join " . TABLE_PRODUCTS . " p on xp.xsell_id = p.products_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where xp.products_id = '" . $_GET['products_id'] . "' and p.products_status = '1' order by sort_order asc limit " . MAX_DISPLAY_XSELL);

	$num_products_xsell = tep_db_num_rows($xsell_query);
	if ($num_products_xsell > 0) {

  $products_xsell_content = NULL;
  
	while ($xsell = tep_db_fetch_array($xsell_query)) {
    $products_xsell_content .= '<div class="col-sm-6 col-md-4" itemprop="itemListElement" itemscope="" itemtype="http://schema.org/Product">';
	  $products_xsell_content .= ' <br><div class="productHolder equal-height">';

    if (PRODUCT_LIST_IMAGE > 0) {
    	$image = '';

			if ($xsell['image_display'] == 1) {
				$image = '<a href="' . tep_href_link('product_info.php', 'products_id=' . $xsell['products_id']) . '">' . '<img src="../images/list_price_std.png" alt="" border="0" />' . '</a><br>';
			} elseif (($xsell['image_display'] != 2) && tep_not_null($xsell['products_image'])) {
				$image = '<a href="' . tep_href_link('product_info.php', 'products_id=' . $xsell['products_id']) . '">' . tep_image('images/'  . $xsell['products_image'], $xsell['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
			}
      
      if (isset($_GET['manufacturers_id'])  && tep_not_null($_GET['manufacturers_id'])) {
        $products_xsell_content .= '    <a href="' . tep_href_link('product_info.php', 'manufacturers_id=' . $_GET['manufacturers_id'] . '&products_id=' . $xsell['products_id']) . '"><div class="wdw_carousel-inner">' . $image . '</div></a>';
      } else {
        $products_xsell_content .= '    <a href="' . tep_href_link('product_info.php', (isset($sort) ? 'sort=' . $sort . '&' : '') . ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $xsell['products_id']) . '"><div class="wdw_carousel-inner">' . $image . '</div></a>';
      }

    }
    
    $products_xsell_content .= '    <div class="caption">';
    
    if (PRODUCT_LIST_NAME > 0) {
      $products_xsell_content .= '      <h2 class="group inner list-group-item-heading">';
      if (isset($_GET['manufacturers_id']) && tep_not_null($_GET['manufacturers_id'])) {
        $products_xsell_content .= '    <a itemprop="url" href="' . tep_href_link('product_info.php', 'manufacturers_id=' . $_GET['manufacturers_id'] . '&products_id=' . $xsell['products_id']) . '"><span itemprop="name">' . $xsell['products_name'] . '</span></a>';
      } else {
        $products_xsell_content .= '    <a itemprop="url" href="' . tep_href_link('product_info.php', ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $xsell['products_id']) . '"><span itemprop="name">' . $xsell['products_name'] . '</span></a>';
      }
      $products_xsell_content .= '      </h2>';
    }    

    $extra_list_contents = NULL;
	  if ( (PRODUCT_LIST_MANUFACTURER > 0) && tep_not_null($xsell['manufacturers_id']) ) {
      $extra_list_contents .= '<dt>' . TABLE_HEADING_MANUFACTURER . '</dt>';
      $extra_list_contents .= '<dd><a href="' . tep_href_link('index.php', 'manufacturers_id=' . (int)$xsell['manufacturers_id']) . '">' . $xsell['manufacturers_name'] . '</a></dd>';
    }
	  if ( (PRODUCT_LIST_MODEL > 0) && tep_not_null($xsell['products_model']) ) {
      $extra_list_contents .= '<dt>' . TABLE_HEADING_MODEL . '</dt>';
      $extra_list_contents .= '<dd>' . $xsell['products_model'] . '</dd>';
    }
    
    if ( (PRODUCT_LIST_QUANTITY > 0) && (tep_get_products_stock($xsell['products_id']) > 0) ) {

			$qty = $xsell['products_quantity'];
      $extra_list_contents .= '<dt>' . TABLE_HEADING_QUANTITY . '</dt>';
      $extra_list_contents .= '<dd>' . $qty . '</dd>';

    }
    
	  if (PRODUCT_LIST_WEIGHT > 0) {
      $extra_list_contents .= '<dt>' . TABLE_HEADING_WEIGHT . '</dt>';
      $extra_list_contents .= '<dd>' . $xsell['products_weight'] . '</dd>';
    }

    if (tep_not_null($extra_list_contents)) {
       $products_xsell_content .= '    <dl class="dl-horizontal list-group-item-text">';
       $products_xsell_content .=  $extra_list_contents;
       $products_xsell_content .= '    </dl>';
    }

	  if ( (PRODUCT_LIST_PRICE > 0) || (PRODUCT_LIST_BUY_NOW > 0) ) {
      $products_xsell_content .= '<div class="row">';
      if ($xsell['products_request'] != '1') {
      	if (PRODUCT_LIST_PRICE > 0) {
      	
          
	        if (tep_not_null($xsell['specials_new_products_price'])) {
        		$products_xsell_content .= '<div class="col-xs-12" itemprop="offers" itemscope itemtype="http://schema.org/Offer"><meta itemprop="priceCurrency" content="' . tep_output_string($currency) . '" /><div class="btn-group" role="group"><del>' .  $currencies->display_price($xsell['products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])) . '</del></span>&nbsp;&nbsp;<span class="productSpecialPrice" itemprop="price" content="' . $currencies->display_raw($xsell['specials_new_products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])) . '">' . $currencies->display_price($xsell['specials_new_products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])) . '</span></div></div>';
        	} else {
        		$products_xsell_content .= '<div class="col-xs-12" itemprop="offers" itemscope itemtype="http://schema.org/Offer"><meta itemprop="priceCurrency" content="' . tep_output_string($currency) . '" /><div class="btn-group" role="group"><span itemprop="price" content="' . $currencies->display_raw($xsell['products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])) . '">' . $currencies->display_price($xsell['products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])) . '</span></div></div>';
        	}
      	}
    	}
      $products_xsell_content .= '</div>';
      $products_xsell_content .= '<div class="row">';
      if (PRODUCT_LIST_BUY_NOW > 0) {

  		  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;
      }


      $products_xsell_content .= '      </div>';
    }

    $products_xsell_content .= '    </div>';
    $products_xsell_content .= '  </div>';
    $products_xsell_content .= '</div>';
  }
?>

  <div itemscope itemtype="http://schema.org/ItemList">
    <meta itemprop="itemListOrder" content="http://schema.org/ItemListUnordered" />
    <meta itemprop="numberOfItems" content="<?php echo MAX_DISPLAY_XSELL; ?>" />

    <h3 itemprop="name"><?php echo TEXT_XSELL_PRODUCTS; ?></h3>

    <div class="row list-group">
      <?php echo $products_xsell_content; ?>
    </div>
    
  </div>
<?php
   }
 }
?>

 

Share this post


Link to post
Share on other sites

In der /catalog/includes/application_top.php

ändere

 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');
      }
    } 

zu:

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') {
      	$parameters = array('action', 'pid', 'products_id');
     	} else {
      	$parameters = array('action', 'pid');
     	}
   	}

Die original Änderung für die x-sell in der application_top.php habe ich bei mir geändert, sind völlig sinnlos.

Probiers mal mit der o.g. Änderung.

Edited by mcmannehan

  • The clever one learn from everything and from everybody
  • The normal one learn from his experience
  • The silly one knows everything better

[socrates, 412 before Christ]

Computers help us with the problems we wouldn't have without them!
99.9% of the bugs sit in front of the computer!
My programmed add-ons: WDW EasyTabs 1.0.3, WDW Facebook Like 1.0.0

if(isset($this) || !isset($this)){ // that's the question...

 

Share this post


Link to post
Share on other sites

In Deiner /catalog/modules/xsell_products.php sind Änderungen vorhanden, die nicht der Original xsell_products.php entsprechen.

Nehme die original Datei ohne die Änderungen, dann sollte es funktionieren.

Und poste mal den Link, der erzeugt wird, wenn Du auf Kaufen klickst. Der Link ist sicherlich falsch, da auch die Original Datei fehlerhaft umprogrammiert wurde.

 

Edited by mcmannehan

  • The clever one learn from everything and from everybody
  • The normal one learn from his experience
  • The silly one knows everything better

[socrates, 412 before Christ]

Computers help us with the problems we wouldn't have without them!
99.9% of the bugs sit in front of the computer!
My programmed add-ons: WDW EasyTabs 1.0.3, WDW Facebook Like 1.0.0

if(isset($this) || !isset($this)){ // that's the question...

 

Share this post


Link to post
Share on other sites

Ja mcmannehan hat Recht. Das ist nicht nötig. Es gibt jedoch kein Modul der das macht was du willst. nicht einmal das Modul für ebenfalls gekaufte Produkte hat einen Kaufbutton

Hier eine etwas andere Lösung falls es nicht funktionieren sollte wie oben beschrieben:

application_top.php

case 'buy_now_xsell' :  if (isset($_GET['products_id'])) {
                                if (tep_has_product_attributes($_GET['products_id'])) {
                                  tep_redirect(tep_href_link('product_info.php', 'products_id=' . $_GET['products_id']));
                                } else {
                                  $cart->add_cart($_GET['products_id'], $cart->get_quantity($_GET['products_id'])+1);
                                  $messageStack->add_session('product_action', sprintf(PRODUCT_ADDED, tep_get_products_name((int)$_GET['products_id'])), 'success');
                                }
                              }
                              tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
                              break;

und hier die xsell.php

<?php
/*
$Id

osCommerce, Open Source E-Commerce Solutions
<http://www.oscommerce.com>

Copyright (c) 2018 osCommerce

Released under the GNU General Public License
*/
//fixed bug

if ((USE_CACHE == 'true') && empty($SID)) {
	// include currencies class and create an instance
	require_once('includes/classes/currencies.php');
	$currencies = new currencies();
}

if ($_GET['products_id']) {

	$xsell_query = tep_db_query("select distinct p.products_id, p.products_image, pd.products_name, p.products_tax_class_id, products_price, products_baseprice, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price
	from products_xsell xp left join " . TABLE_PRODUCTS . " p on xp.xsell_id = p.products_id
	left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "'
	left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id 
	where xp.products_id = '" . $_GET['products_id'] . "'
	and p.products_status = '1'
	order by sort_order asc limit " . MAX_DISPLAY_XSELL);

$num_products_xsell = tep_db_num_rows($xsell_query);
if ($num_products_xsell > 0) {
?>
<div class="col-sm-12">

<h3><?php echo TEXT_XSELL_PRODUCTS; ?></h3>
  <div class="row list-group">
<?php
$position = 1;
     while ($xsell = tep_db_fetch_array($xsell_query)) {
?>
    <div class="col-sm-4">
	 <div class="thumbnail equal-height">
<?php
// PLS Taxinfo, Shippinginfo, Baseprice start
    $pls_taxinfo = ( DISPLAY_TAX_INFO == 'true' ) ? ( DISPLAY_PRICE_WITH_TAX == 'true' ) ? '<br /><span class="pls_taxInfomodules">'. sprintf(TEXT_INCL_VAT, tep_get_tax_rate($xsell['products_tax_class_id']).'%') . '</span>' : '<br /><span class="pls_taxInfomodules">' . TEXT_EXCL_VAT . '</span>' : '';
    $pls_shipping_info = ( SHOW_SHIPPING_COST == 'true' ) ?  '<br><span class="pls_Shippingtext" align="center">' . MODULE_STORE_SHIPPING_TITLE . '</span>' : '';
    $pls_baseprice_query = "SELECT products_baseprice FROM " . TABLE_PRODUCTS . " WHERE products_status = '1' AND products_id = '" . $xsell['products_id'] . "'";
    $pls_baseprice = '  <br><span class="pls_basePrice">' . $xsell['products_baseprice'] . '</span>';
// PLS Taxinfo, Shippinginfo, Baseprice ende  

			if (tep_not_null($xsell['specials_new_products_price'])) {
				$xsell_price =  '<s>' . $currencies->display_price($xsell['products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])) . '</s><br>';
       	        $xsell_price .= '<span class="productSpecialPrice">' . $currencies->display_price($xsell['specials_new_products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])) . $pls_baseprice . $pls_taxinfo . $pls_shipping_info . '</span>';
			} else {
				$xsell_price =  $currencies->display_price($xsell['products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])) . $pls_baseprice . $pls_taxinfo . $pls_shipping_info;
			}
 ?>	 


<?php
    if (PRODUCT_LIST_IMAGE > 0) {
			echo '<a href="' . tep_href_link('product_info.php', 'products_id=' . $xsell['products_id']) . '">' . tep_image('images/'  . $xsell['products_image'], $xsell['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
			}
			
?>


	  <div class="caption">
		<p class="text-center">
			<?php echo '<a href="' . tep_href_link('product_info.php', 'products_id=' . $xsell['products_id']) . '">' . $xsell['products_name'] .'</a>'; ?>
		</p> 
		<hr>
          <p class="text-center"> 
		    <?php echo $xsell_price; ?>
		  </p> 
		  <div class="text-center">
            <div class="btn-group">
			  <a href="<?php echo tep_href_link('product_info.php', tep_get_all_get_params(array('action')) . 'products_id=' . $xsell['products_id']); ?>" class="btn btn-default" role="button"><?php echo SMALL_IMAGE_BUTTON_VIEW; ?></a>
               <?php if (SHOW_BUTTON_BUY_NOW == 'true') {
               echo '<a href="' . tep_href_link($PHP_SELF, tep_get_all_get_params(array('action')) . 'action=buy_now_xsell&products_id=' . (int)$xsell['products_id']) . '" class="btn btn-success btn-index btn-buy" role="button">' . IMAGE_BUTTON_BUY_NOW . '</a>'; 
               } ?>			  
			</div>
          </div>
      </div>
     </div>
    </div>
 <?php
	$position++;
       } //eof while 
?>
  </div> 
</div>

<?php
     } // eof ($num_products_xsell > 0)
   } // eof $_GET['products_id']
?>

 

Share this post


Link to post
Share on other sites

×