Antwort #1 am: 31. Januar 2017, 10:50:59
...erschlagt mich jetzt nicht
- ich weiß, dass das nicht elegant gelöst ist, jedoch bleiben unsere Produkt-ID's und Bezeichnungen der Leuchtmittel ersteinmal für eine lange Zeit gleich.
In der shopping_cart.php habe ich das so gelöst (Auszug, an zwei Beispielen)
// START CROSS SELLING WARENKORB TYP1 GU10 WW require_once (DIR_FS_INC
.'xtc_get_vpe_name.inc.php'); $typ1gu10ww_query = xtc_db_query
("SELECT p.products_id, pd.products_name, p.products_image, p.products_tax_class_id, p.products_price, p.products_vpe_status, p.products_vpe_value, p.products_vpe
FROM products_to_categories ptc, categories_description cd, products p, products_description pd
WHERE cd.categories_name='CROSS_TYP1_GU10_WW'
AND cd.language_id=2
AND ptc.categories_id=cd.categories_id
AND p.products_id=5
AND pd.products_id=5
AND pd.language_id='".$_SESSION['languages_id']."'
ORDER by RAND() LIMIT 3"); $module_content = array (); while ($special = xtc_db_fetch_array
($typ1gu10ww_query)) { $products_price = $xtPrice->xtcGetPrice($special['products_id'], $format = true, 1, $special['products_tax_class_id'], $special['products_price'], 1); $special_image = '<a href="'.xtc_href_link
(FILENAME_PRODUCT_INFO
, xtc_product_link
($special['products_id'], $special['products_name'])).'">'.xtc_image
(DIR_WS_THUMBNAIL_IMAGES
.$special['products_image'], $special['products_name']).'</a>'; $special_name = '<a href="'.xtc_href_link
(FILENAME_PRODUCT_INFO
, xtc_product_link
($special['products_id'], $special['products_name'])).'">'.$special['products_name'].'</a>'; $special_buy_now = '<a href="'.xtc_href_link
(FILENAME_PRODUCT_INFO
, xtc_product_link
($special['products_id'], $special['products_name'])).'">'.xtc_image_button
('button_buy_now.gif', TEXT_BUY
.$special['products_name'].TEXT_NOW
).'</a>'; $typ1gu10ww[] = array ('SPECIAL_NAME' => $special_name, 'SPECIAL_VPE' => $vpe, 'SPECIAL_ID' => $special['products_id'], 'SPECIAL_IMAGE' => $special_image, 'SPECIAL_PRICE' => $products_price['formated'], 'SPECIAL_BUY_NOW' => $special_buy_now); }// END CROSS SELLING WARENKORB TYP1 GU10 WW// START CROSS SELLING WARENKORB TYP3 GU10 WW require_once (DIR_FS_INC
.'xtc_get_vpe_name.inc.php'); $typ3gu10ww_query = xtc_db_query
("SELECT p.products_id, pd.products_name, p.products_image, p.products_tax_class_id, p.products_price, p.products_vpe_status, p.products_vpe_value, p.products_vpe
FROM products_to_categories ptc, categories_description cd, products p, products_description pd
WHERE cd.categories_name='CROSS_TYP3_GU10_WW'
AND cd.language_id=2
AND ptc.categories_id=cd.categories_id
AND p.products_id=29
AND pd.products_id=29
AND pd.language_id='".$_SESSION['languages_id']."'
ORDER by RAND() LIMIT 3"); $module_content = array (); while ($special = xtc_db_fetch_array
($typ3gu10ww_query)) { $products_price = $xtPrice->xtcGetPrice($special['products_id'], $format = true, 1, $special['products_tax_class_id'], $special['products_price'], 1); $special_image = '<a href="'.xtc_href_link
(FILENAME_PRODUCT_INFO
, xtc_product_link
($special['products_id'], $special['products_name'])).'">'.xtc_image
(DIR_WS_THUMBNAIL_IMAGES
.$special['products_image'], $special['products_name']).'</a>'; $special_name = '<a href="'.xtc_href_link
(FILENAME_PRODUCT_INFO
, xtc_product_link
($special['products_id'], $special['products_name'])).'">'.$special['products_name'].'</a>'; $special_buy_now = '<a href="'.xtc_href_link
(FILENAME_PRODUCT_INFO
, xtc_product_link
($special['products_id'], $special['products_name'])).'">'.xtc_image_button
('button_buy_now.gif', TEXT_BUY
.$special['products_name'].TEXT_NOW
).'</a>'; $typ3gu10ww[] = array ('SPECIAL_NAME' => $special_name, 'SPECIAL_VPE' => $vpe, 'SPECIAL_ID' => $special['products_id'], 'SPECIAL_IMAGE' => $special_image, 'SPECIAL_PRICE' => $products_price['formated'], 'SPECIAL_BUY_NOW' => $special_buy_now); }// END CROSS SELLING WARENKORB TYP3 GU10 WW In der /templates/tpl/module/shopping_cart.html erfolgt so die Ausgabe:
{if $MODULE_order_details|strstr:"TYP1 / GU10"}{if $MODULE_order_details|strstr:"LED Leuchtmittel, 1,2 Watt Warmwei"}{else}<br
> {foreach name
=aussen item
=module_data from
=$typ1gu10ww}<div
class="hidden-phone" id
="order_details_desktop"><div
class="row-fluid bottom-line tableheader"><div
class="span12"><div
class="span8 image text-left"> 
; 
; 
;Weiteres Ersatzleuchtmittel dazubestellen
</div
></div
></div
> <div
class="row-fluid bottom-line tablecontent"><div
class="span12"><div
class="span2 image text-center" colspan
="2">{$module_data.SPECIAL_IMAGE
}</div
><div
class="span6 cname"><strong
>{$module_data.SPECIAL_NAME
}</strong
></div
><div
class="span1 text-center">{$module_data.SPECIAL_BUY_NOW
}</div
><div
class="span1 subtotal text-center nobr">{$module_data.SPECIAL_PRICE
}</div
></div
></div
> </div
><br
> {/foreach} {/if}{/if}{if $MODULE_order_details|strstr:"TYP3 / GU10-230V / Warm"}{if $MODULE_order_details|strstr:"LED Leuchtmittel, 3,3 Watt Warmwei"}{else}<br
> {foreach name
=aussen item
=module_data from
=$typ3gu10ww}<div
class="hidden-phone" id
="order_details_desktop"><div
class="row-fluid bottom-line tableheader"><div
class="span12"><div
class="span8 image text-left"> 
; 
; 
;Weiteres Ersatzleuchtmittel dazubestellen
</div
></div
></div
> <div
class="row-fluid bottom-line tablecontent"><div
class="span12"><div
class="span2 image text-center" colspan
="2">{$module_data.SPECIAL_IMAGE
}</div
><div
class="span6 cname"><strong
>{$module_data.SPECIAL_NAME
}</strong
></div
><div
class="span1 text-center">{$module_data.SPECIAL_BUY_NOW
}</div
><div
class="span1 subtotal text-center nobr">{$module_data.SPECIAL_PRICE
}</div
></div
></div
> </div
><br
> {/foreach} {/if}{/if} Ich habe zumindest jetzt schonmal gesehen, dass durch {$module_data.SPECIAL_BUY_NOW} in der shopping_cart.php tatsächlich nur ein Link generiert wird
$special_buy_now = '<a href="'.xtc_href_link(FILENAME_PRODUCT_INFO, xtc_product_link($special['products_id'], $special['products_name'])).'">'.xtc_image_button('button_buy_now.gif', TEXT_BUY.$special['products_name'].TEXT_NOW).'</a>';
, jedoch keine Idee wie ich stattdessen "In den Warenkorb legen" ausdrücke.