Neuigkeiten
  • Die modified eCommerce Shopsoftware ist kostenlos, aber nicht umsonst.
    Spenden
  • Damit wir die modified eCommerce Shopsoftware auch zukünftig kostenlos anbieten können:
    Spenden
  • Thema: specials im Warenkorb anzeigen

    lullifatz

    • Fördermitglied
    • Beiträge: 474
    specials im Warenkorb anzeigen
    am: 19. September 2014, 22:32:48
    Hallo,

    ich möchte gerne Sonderangebote im Warenkorb anzeigen lassen. Ich habe es ganz plump mit
    Code: PHP  [Auswählen]
    {$MODULE_specials}
    versucht. Leider ohne erfolg. Hat jemand eine Idee, wie ich das realisieren kann?

    Linkback: https://www.modified-shop.org/forum/index.php?topic=31088.0

    hpzeller

    • Experte
    • Beiträge: 4.129
    • Geschlecht:
    Re: specials im Warenkorb anzeigen
    Antwort #1 am: 20. September 2014, 00:00:01
    Hallo lullifatz

    Vorschlag:

    1.
    Füge in ‘shopping_cart.php’
    zwischen den folgenden zwei Zeilen
    Code: PHP  [Auswählen]
    $smarty->assign('language', $_SESSION['language']);
    $main_content = $smarty->fetch(CURRENT_TEMPLATE.'/module/shopping_cart.html');
    folgenden Code ein
    Code: PHP  [Auswählen]
    //BOF special content /////////////////////////////////////////////////////
    require_once (DIR_FS_INC.'xtc_get_short_description.inc.php');

    //fsk18 lock
    $fsk_lock = '';
    if ($_SESSION['customers_status']['customers_fsk18_display'] == '0') {
      $fsk_lock = ' and p.products_fsk18!=1';
    }
    if (GROUP_CHECK == 'true') {
      $group_check = " and p.group_permission_".$_SESSION['customers_status']['customers_status_id']."=1 ";
    }
    //BOF - DokuMan - 2010-01-26 - use Join on TABLE_PRODUCTS_DESCRIPTION & TABLE_SPECIALS
    $specials_query_raw = "select p.products_id,
                                  pd.products_name,
                                  p.products_price,
                                  p.products_tax_class_id,
                                  p.products_shippingtime,
                                  p.products_image,
                                  p.products_vpe_status,
                                  p.products_vpe_value,
                                  p.products_vpe,
                                  p.products_fsk18,
                                  s.expires_date,
                                  s.specials_new_products_price
                                 from
                                  "
    .TABLE_PRODUCTS." p
                                 left join "
    .TABLE_PRODUCTS_DESCRIPTION." pd
                                  on p.products_id = pd.products_id
                                 left join "
    .TABLE_SPECIALS." s
                                  on p.products_id = s.products_id
                                 where p.products_status = '1'
                                 and s.products_id = p.products_id
                                 and p.products_id = pd.products_id
                                 "
    .$group_check."
                                 "
    .$fsk_lock."
                                 and pd.language_id = '"
    .(int)$_SESSION['languages_id']."'
                                 and s.status = '1'
                                 order by s.specials_date_added DESC"
    ;
    //EOF - DokuMan - 2010-01-26 - use Join on TABLE_PRODUCTS_DESCRIPTION & TABLE_SPECIALS
    $specials_split = new splitPageResults($specials_query_raw, isset($_GET['page']) ? $_GET['page'] : 0, MAX_DISPLAY_SPECIAL_PRODUCTS);

    $module_content = '';
    $row = 0;
    if ($specials_split->number_of_rows==0) xtc_redirect(xtc_href_link(FILENAME_DEFAULT));

    $specials_query = xtc_db_query($specials_split->sql_query);

    while ($specials = xtc_db_fetch_array($specials_query)) {
      $module_content[] = $product->buildDataArray($specials);
    }

    if (($specials_split->number_of_rows > 0)) {
    //BOF - Dokuman - 2009-06-05 - replace table with div
    /*
      $smarty->assign('NAVBAR', '
      <table border="0" width="100%" cellspacing="0" cellpadding="2">
                <tr>
                  <td class="smallText">'.$specials_split->display_count(TEXT_DISPLAY_NUMBER_OF_SPECIALS).'</td>
                  <td align="right" class="smallText">'.TEXT_RESULT_PAGE.' '.$specials_split->display_links(MAX_DISPLAY_PAGE_LINKS, xtc_get_all_get_params(array ('page', 'info', 'x', 'y'))).'</td>
                </tr>
              </table>
      ');
    */

      $smarty->assign('NAVBAR', '
      <div style="width:100%;font-size:smaller">
        <div style="float:left">'
    .$specials_split->display_count(TEXT_DISPLAY_NUMBER_OF_SPECIALS).'</div>
        <div style="float:right">'
    .TEXT_RESULT_PAGE.' '.$specials_split->display_links(MAX_DISPLAY_PAGE_LINKS, xtc_get_all_get_params(array ('page', 'info', 'x', 'y'))).'</div>
        <br style="clear:both" />
      </div>
      '
    );
    //EOF - Dokuman - 2009-06-05 - replace table with div
    }


    $smarty->assign('module_content', $module_content);
    $special_content = $smarty->fetch(CURRENT_TEMPLATE.'/module/specials.html');
    $smarty->assign('SPECIAL_content', $special_content);
    //EOF special content /////////////////////////////////////////////////////
     

    2.
    Füge in ‘templates/xtc5/module/shopping_cart.html’
    ganz am Ende nach
    Code: XML  [Auswählen]
    {$MODULE_gift_cart}
    folgenden Code ein
    Code: XML  [Auswählen]
    {$SPECIAL_content}

    Gruss
    Hanspeter

    lullifatz

    • Fördermitglied
    • Beiträge: 474
    Re: specials im Warenkorb anzeigen
    Antwort #2 am: 20. September 2014, 21:48:21
    Viel Dank für Deine Hilfe! So funktioniert es!

    Danke :mrgreen:
    Trade Republic - Provisionsfrei Aktien handeln
    17 Antworten
    5965 Aufrufe
    27. November 2015, 16:35:42 von Viol
    10 Antworten
    6970 Aufrufe
    10. Oktober 2011, 18:08:38 von Jürgen
    66 Antworten
    31183 Aufrufe
    29. Oktober 2015, 17:38:00 von trendco
    5 Antworten
    3849 Aufrufe
    21. Juli 2011, 15:58:17 von Tomcraft