Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

kann mir jemand helfen ein script zu erstellen mit dem ich über diesen link ein  popup öffnen kann.

 

<?php if (DISPLAY_CART == 'false') {
                              echo tep_draw_button(IMAGE_BUTTON_PROD_ATTRIBUTES, 'lightbulb', tep_href_link(FILENAME_ATTRIBUTE_POPUP, 'products_id=' . $all_products['products_id']) . '"target="_blanc"' );
                              }else{
                              }
                              ?>

 

Ich möchte, das das fenster die grösse 300 auf 650 hat. 
Komme damit nicht zurecht.

Posted

Ohne Gewähr:

<script type="text/javascript">
    function openWinYepi() {
        winx0 = (window.screenLeft != undefined ? window.screenLeft : window.screenX) + 50;
        window.open('<?php echo tep_href_link(FILENAME_ATTRIBUTE_POPUP, 'products_id=' . $all_products['products_id']); ?>', 'yepiPopWindow', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=300,height=650,screenX='+ winx0 + ',screenY=150,top=150,left=' + winx0);
    }
</script>
<?php 
    $params = array(
        'type'      => 'button',
        'newwindow' => true,
        'params'    => 'onclick="openWinYepi();return false;"'
    );
    if (DISPLAY_CART == 'false') {
        echo tep_draw_button(IMAGE_BUTTON_PROD_ATTRIBUTES, 'lightbulb', tep_href_link(FILENAME_ATTRIBUTE_POPUP, 'products_id=' . $all_products['products_id']), null, $params);
    }
?> 

 

Posted

Danke Ingo, Alles klappt super bis auf die products_id 

Sobald das popup aufgeht zeigt der mir ein anderes Produkt als das was eigentlich kommen sollte.
Was aber komisch ist, wenn ich mit der maus über den Button fahre kommt die richtige ID beim anklicken jedoch wird ein anderes Produkt aufgerufen.

Posted

Also ich verstehe es nicht,
mit diesem Link funzt alles ganz normal:

 . tep_draw_button(IMAGE_BUTTON_IN_CART, 'plusthick', tep_href_link(FILENAME_ATTRIBUTE_POPUP, 'products_id=' . $all_products['products_id']) . '"target="_blanc"' );

 

Damit nicht:

<script type="text/javascript">
    function openWinYepi() {
        winx0 = (window.screenLeft != undefined ? window.screenLeft : window.screenX) + 50;
        window.open('<?php echo tep_href_link(FILENAME_ATTRIBUTE_POPUP, 'products_id=' . $all_products['products_id']); ?>', 'yepiPopWindow', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=300,height=650,screenX='+ winx0 + ',screenY=150,top=150,left=' + winx0);
    }
</script>
<?php 
    $params = array(
        'type'      => 'button',
        'newwindow' => true,
        'params'    => 'onclick="openWinYepi();return false;"'
    );
    if (DISPLAY_CART == 'false') {
        echo tep_draw_button(IMAGE_BUTTON_PROD_ATTRIBUTES, 'lightbulb', tep_href_link(FILENAME_ATTRIBUTE_POPUP, 'products_id=' . $all_products['products_id']), null, $params);
    }
?>

Dazugehörige query:

  $categories_name = '';
  if (!empty($hiddencats)) {
    $all_products_query = tep_db_query("select c.categories_id, c.categories_name, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_tax_class_id, p.products_price, pd.products_name, pd.products_description, m.manufacturers_id, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join . " . TABLE_MANUFACTURERS . " m on m.manufacturers_id = p.manufacturers_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES_DESCRIPTION . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc where p.products_id = pd.products_id and p.products_id = pc.products_id and p.products_status = 1 and pc.categories_id = c.categories_id AND c.language_id = '" . (int)$languages_id . "' and pd.language_id = '" . (int)$languages_id . "' and (not (pc.categories_id in (" . implode(',', $hiddencats) . "))) group by p.products_id order by c.categories_name, pd.products_name asc");
} else {
    $all_products_query = tep_db_query("select c.categories_id, c.categories_name, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_tax_class_id, p.products_price, pd.products_name, pd.products_description, m.manufacturers_id, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join . " . TABLE_MANUFACTURERS . " m on m.manufacturers_id = p.manufacturers_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES_DESCRIPTION . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc where p.products_id = pd.products_id and p.products_id = pc.products_id and p.products_status = 1 and pc.categories_id = c.categories_id AND c.language_id = '" . (int)$languages_id . "' and pd.language_id = '" . (int)$languages_id . "'" . " order by c.categories_name, pd.products_name asc");
}

    while ($all_products = tep_db_fetch_array($all_products_query)) {
      if($categories_name != $all_products['categories_name']) {

 

Bin schon seit Tagen damit beschäftigt komme aber nicht weiter. Falls jemand noch helfen kann, danke ich schon im voraus. 

  • 2 weeks later...
Posted (edited)

so funktioniert es mit dem Popup ;)

<a href='<?php echo tep_href_link(FILENAME_ATTRIBUTE_POPUP, 'products_id=' . $all_products['products_id']); ?>', target="_blank" onclick="window.open(this.href,this.target,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=420,height=780,screenX=150,screenY=150,top=5,left=650'); return false;"><?php echo tep_draw_button(IMAGE_BUTTON_PROD_ATTRIBUTES, 'plusthick');?>

Die Anzeige des Buttons nur bei aktiven Attributen ist immer noch ein Thema. 

Edited by Yepi
  • 3 weeks later...
Posted

so langsam verzweifle ich schon.

ich krieg die product_listing.php nicht hin mit dem popup. 

hat jemand ne Idee wie es machbar wäre ? hier mein code

              if($listing['products_quantity']>0) {
if (SHOW_BUY_NOW_PROD_ATTRIB == 'false') { 
             
              $prod_list_contents .= '        <td align="center" width="20%">' . tep_draw_button(IMAGE_BUTTON_SHOW_DETAILS, 'help', tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id'])) . '<p>'  . tep_draw_button(TEXT_ADD_WISHLIST, 'clipboard', tep_href_link($PHP_SELF, tep_get_all_get_params(array('action', 'products_id')) . 'action=add_wishlist&products_id=' . $listing['products_id'])) . '<p>' . tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'cart', tep_href_link($PHP_SELF, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id'])) . $in_cart .  '</td>';
             }else{
              $prod_list_contents .= '        <td align="center" width="20%">' . tep_draw_button(IMAGE_BUTTON_SHOW_DETAILS, 'help', tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id'])) . '<p>'  . tep_draw_button(TEXT_ADD_WISHLIST, 'clipboard', tep_href_link($PHP_SELF, tep_get_all_get_params(array('action', 'products_id')) . 'action=add_wishlist&products_id=' . $listing['products_id'])) . '<p>' . tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'plusthick', tep_href_link(FILENAME_ATTRIBUTE_POPUP, 'products_id=' . $listing['products_id']) . '"target="_blanc"' ). $in_cart .  '</td>'; 
            }
              }else{

             $prod_list_contents .= ' <td align="center" width="20%"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' .
              tep_image(DIR_WS_LANGUAGES . $language . '/' . 'images/buttons/button_mod_sold_out.png') . '</a>';
              }
              break;

 

×
×
  • Create New...