Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

milerwan

Members
  • Posts

    363
  • Joined

  • Last visited

  • Days Won

    8

Reputation Activity

  1. Thanks
    milerwan got a reaction from thierryc in osCommerce v4 translation   
    Here is the French traduction file, sorry for delay.
    Keys_2021Dec21_1418_fr.zip
  2. Like
    milerwan got a reaction from domiosc in osCommerce v4 translation   
    Here is the French traduction file, sorry for delay.
    Keys_2021Dec21_1418_fr.zip
  3. Like
    milerwan got a reaction from osCommerce-Official in osCommerce v4 demo   
    I'm interesting by this demo too.
  4. Like
    milerwan got a reaction from valquiria23 in Store Search Bar (BS)   
    @valquiria23

    Your version supports BS3 or BS4 ?
    This addon has got BS3 icons but can easily be updated to reach BS4 icons system.
  5. Like
    milerwan got a reaction from valquiria23 in Store Search Bar (BS)   
    @valquiria23
    It is for 2.3.4 BS Edge (or Master) and could work with Frozen I think.
    You must have new "seo" fields in the database to get "product keywords" and "category alt name" searches (or use Head Tags SEO addon instead)

    NB: This version can't work for Phoenix as it stands.
  6. Thanks
    milerwan got a reaction from valquiria23 in Store Search Bar (BS)   
    Store Search with Image (BS) v1.6

    Some notable improvements :
    PHP 7.x compatibility ("class cm_header_store_search" and "class ht_search_result_highlight" with function __construct() fix). "Category name" search field setting : Allow you to keep Basic "categories_name" field (for search and display results) or use Alternative Title search instead (Standard "categories_seo_title" or "categories_htc_title_tag_alt" from Header Tags SEO v3.x addon). New additional/optional search fields in admin : "product model", "product gtin", "product manufacturer name" (to match, if necessary, with "advanced_search_result.php" number of results). Additional/optional search field Keywords amended to match with standard 2.3.4 BS "products_seo_keywords" field into search frame. Adjustable number of result entries for "category", "products" and "pages" search. Display number of results for "categories", "products" and "pages" searches into dropdown. Add "p.products_status = 1" condition into product sql query to avoid "disabled" products displaying (\ext\modules\content\header\store_search\content_searches.php). Optimized script for "image or icon for products" (\ext\modules\content\header\store_search\content_searches.php) Full package.
  7. Like
    milerwan got a reaction from Mac2256 in Store Search Bar (BS)   
    Store Search with Image (BS) v1.6

    Some notable improvements :
    PHP 7.x compatibility ("class cm_header_store_search" and "class ht_search_result_highlight" with function __construct() fix). "Category name" search field setting : Allow you to keep Basic "categories_name" field (for search and display results) or use Alternative Title search instead (Standard "categories_seo_title" or "categories_htc_title_tag_alt" from Header Tags SEO v3.x addon). New additional/optional search fields in admin : "product model", "product gtin", "product manufacturer name" (to match, if necessary, with "advanced_search_result.php" number of results). Additional/optional search field Keywords amended to match with standard 2.3.4 BS "products_seo_keywords" field into search frame. Adjustable number of result entries for "category", "products" and "pages" search. Display number of results for "categories", "products" and "pages" searches into dropdown. Add "p.products_status = 1" condition into product sql query to avoid "disabled" products displaying (\ext\modules\content\header\store_search\content_searches.php). Optimized script for "image or icon for products" (\ext\modules\content\header\store_search\content_searches.php) Full package.
  8. Thanks
    milerwan got a reaction from Philo2005 in Show PayPal fee in order total   
    Thank you for feedback !

    1. You can get update v2.0.1 that solves PHP 7.x issue and installation issue too (my fault) : https://apps.oscommerce.com/6aWHK&paypal-fee-v2

    * Update V2.0.1
    - PHP 7.x compatibility fixed (includes > modules > order_total > ot_paypal_fee.php, line 42) :
     "function ot_paypal_fee()" replace by "function __construct()"
    - Fix installation error due to backslash missing (includes > modules > order_total > ot_paypal_fee.php, line 150) :
     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Ordre de tri', 'MODULE_ORDER_TOTAL_PAYPAL_SORT_ORDER', '4', 'Ordre de tri pour l\'affichage (Le plus petit nombre est montré en premier).', '6', '5', now())");
     
    2. Yes, this module only supports PayPal Standard solution... Your comment has been added to the apps :

    IMPORTANT: Works only with PayPal Standard solution.
     
    Sincerely
  9. Like
    milerwan got a reaction from SCH_001 in Show PayPal fee in order total   
    You can't partially refund an order in case of return of product(s) or entire cancellation by the customer unless it is a non-recoverable product/service listed on the invoice.
    Hence the interest to include additional costs that are added to the total to be deducted from the rest if necessary.
    Do not be afraid to charge a processing fee, customers are aware that PayPal is not only a payment solution but an associated service that gives them advantages!

    If customers are not willing to pay fees to use PayPal then they are free to choose another payment method... 
  10. Thanks
    milerwan got a reaction from peterpil19 in Show PayPal fee in order total   
    I have just uploaded at the moment (2 times by mistake ^^) my module.
    Here are the links :
    - https://apps.oscommerce.com/6aWHK&paypal-fee-v2
    - https://apps.oscommerce.com/Uyola&paypal-fee-v2
  11. Like
    milerwan got a reaction from valquiria23 in Ezsocial for osC2.3.4BS v1.0a   
    @frankl
    New Ezsocial for osC 2.3.4 BS v1.0b (ezsocial_for_edge_1.0b.rar" file) with :
    - "Welcome back" messageStack fixed for multi languages
    - Bug fix for "compound names" (addressed above)
    - Remodeling email field with "tep_draw_input_field" function with disabled parameter
    - New social buttons with BS css look (streamlined css, text-center, perfect alignment whatever the language used, hover darker)
    - Updated English and French languages

    NB: If you find bugs, please report here.
    ezsocial_for_edge_1.0b.rar
  12. Like
    milerwan got a reaction from valquiria23 in Ezsocial for osC2.3.4BS v1.0a   
    @frankl
    During my tests, I can recover from Google or Facebook the "First Name" but the "Last name" is incomplete when it is a "compound name" (= with several words).

    For example :
    - First name "Diego" => "Diego"
    - Last name "de la Vegas" => "de"

    Maybe it will be the same if first name is also composed :
    - "Don Diego" => "Don"

    Do you meet the same problem?

    --------------------------------------------------------------------

    Ok I have found how to fix it (and arrange the whole) :

    1. In "ezsocial_success.php" file, at line 169, find this :
    echo tep_draw_hidden_field('social_login', NULL, 'value=social_login'); echo tep_draw_hidden_field('ezsocial_type', NULL, 'value=' . $ezsocial_type); echo tep_draw_hidden_field('ezsocial_id', NULL, 'value=' . $ezsocial_id); and replace by this :
    echo tep_draw_hidden_field('social_login', 'social_login'); echo tep_draw_hidden_field('ezsocial_type', $ezsocial_type); echo tep_draw_hidden_field('ezsocial_id', $ezsocial_id);  
    2. At line 207, find this :
    if($firstname == 'Unknown') { echo tep_draw_input_field('firstname', NULL, 'required aria-required="true" id="inputFirstName" placeholder="' . ENTRY_FIRST_NAME_TEXT . '"'); echo FORM_REQUIRED_INPUT; } else { echo tep_draw_input_field('firstname', NULL, 'value=' . $firstname . ' required aria-required="true" id="inputFirstName"'); echo FORM_REQUIRED_INPUT; } And replace by this :
    if($firstname == 'Unknown') { echo tep_draw_input_field('firstname', NULL, 'required aria-required="true" id="inputFirstName" placeholder="' . ENTRY_FIRST_NAME_TEXT . '" maxlength="32"'); echo FORM_REQUIRED_INPUT; } else { echo tep_draw_input_field('firstname', $firstname, 'required aria-required="true" id="inputFirstName" maxlength="32"'); echo FORM_REQUIRED_INPUT; }  
    3. 2. At line 222, find this :
    if($lastname == 'Unknown') { echo tep_draw_input_field('lastname', NULL, 'required aria-required="true" id="inputLastName" placeholder="' . ENTRY_LAST_NAME_TEXT . '"'); echo FORM_REQUIRED_INPUT; } else { echo tep_draw_input_field('lastname', NULL, 'value=' . $lastname . ' required aria-required="true" id="inputLastName" placeholder="' . ENTRY_LAST_NAME_TEXT . '"'); echo FORM_REQUIRED_INPUT; } And replace by this :
    if($lastname == 'Unknown') { echo tep_draw_input_field('lastname', NULL, 'required aria-required="true" id="inputLastName" placeholder="' . ENTRY_LAST_NAME_TEXT . '" maxlength="32"'); echo FORM_REQUIRED_INPUT; } else { echo tep_draw_input_field('lastname', $lastname, 'required aria-required="true" id="inputLastName" maxlength="32"'); echo FORM_REQUIRED_INPUT; }  
    4. At line 252, find this :
    if($email_address == 'Unknown') { echo tep_draw_input_field('email_address', NULL, 'value=' . $email_address . ' required aria-required="true" id="inputEmail" placeholder="' . ENTRY_EMAIL_ADDRESS_TEXT . '"', 'email'); echo FORM_REQUIRED_INPUT; } else { echo tep_draw_hidden_field('email_address', NULL, 'value=' . $email_address . ' required aria-required="true" id="inputEmail" placeholder="' . ENTRY_EMAIL_ADDRESS_TEXT . '"', 'email'); echo $email_address; } And replace by this :
    if($email_address == 'Unknown') { echo tep_draw_input_field('email_address', NULL, 'required aria-required="true" id="inputEmail" placeholder="' . ENTRY_EMAIL_ADDRESS_TEXT . '" maxlength="96"', 'email'); echo FORM_REQUIRED_INPUT; } else { echo tep_draw_input_field('email_address', $email_address, 'required aria-required="true" id="inputEmail" maxlength="96" disabled', 'email'); }
    That's it for fix.
  13. Like
    milerwan got a reaction from Dan Cole in Google XML Sitemap SEO   
    Here is my contribution for 2.3.x users : Sitemap images file with "new large product images" add.*

    *Just 2 functions to replace in "googlesitemap/sitemap.class.php" file (from latest package v1.14a):
    - GenerateSitemapImages($data, $file)
    - GenerateImagesSitemap()

    1a. Edit "sitemap.class.php" file, and find at line 682 :
    function GenerateImagesSitemap(){ $quotes = (defined('QUOTES_CATEGORY_NAME') ? " and customers_email_address = '' and quotes_email_address = ''" : ''); $sql = "SELECT products_id as pID, products_image as img, products_date_added as date_added, products_last_modified as last_mod, products_ordered FROM products WHERE products_status='1'" . $quotes . " ORDER BY products_ordered DESC"; if ( $products_query = tep_db_query($sql) ){ $this->debug['QUERY']['IMAGES']['STATUS'] = 'success'; $this->debug['QUERY']['IMAGES']['NUM_ROWS'] = tep_db_num_rows($products_query); $container = array(); $number = 0; $top = 0; while( $result = tep_db_fetch_array($products_query) ){ $top = max($top, $result['products_ordered']); $location = tep_href_link('product_info.php', 'products_id=' . $result['pID'], 'NONSSL', false); $location_base = $this->base_url; $lastmod = tep_not_null($result['last_mod']) ? $result['last_mod'] : $result['date_added']; $changefreq = GOOGLE_SITEMAP_IMAGES_CHANGE_FREQ; $ratio = $top > 0 ? $result['products_ordered']/$top : 0; $priority = $ratio < .1 ? .1 : number_format($ratio, 1, '.', ''); if ($lastmod == 0) { $lastmod = date("Y-m-d H:m:s"); } $container[] = array('loc' => htmlspecialchars(utf8_encode($location)), 'img' => htmlspecialchars(utf8_encode($location_base) . 'images/' . $result['img'] ), 'lastmod' => date ("Y-m-d", strtotime($lastmod)), 'changefreq' => $changefreq, 'priority' => $priority ); if ( sizeof($container) >= 50000 ){ $type = $number == 0 ? 'images' : 'images' . $number; $this->GenerateSitemapImages($container, $type); $container = array(); $number++; } } # end while tep_db_free_result($products_query); if ( sizeof($container) > 0 ) { $type = $number == 0 ? 'images' : 'images' . $number; return $this->GenerateSitemapImages($container, $type); } # end if } else { $this->debug['QUERY']['IMAGES']['STATUS'] = 'false'; $this->debug['QUERY']['IMAGES']['NUM_ROWS'] = '0'; } } # end function 1b. Replace with :
    function GenerateImagesSitemap(){ $quotes = (defined('QUOTES_CATEGORY_NAME') ? " and customers_email_address = '' and quotes_email_address = ''" : ''); $sql = "SELECT products_id as pID, products_image as img, products_date_added as date_added, products_last_modified as last_mod, products_ordered FROM products WHERE products_status='1'" . $quotes . " ORDER BY products_ordered DESC"; if ( $products_query = tep_db_query($sql) ){ $this->debug['QUERY']['IMAGES']['STATUS'] = 'success'; $this->debug['QUERY']['IMAGES']['NUM_ROWS'] = tep_db_num_rows($products_query); $pre_container = array(); $container = array(); $number = 0; $top = 0; while( $result = tep_db_fetch_array($products_query) ){ $top = max($top, $result['products_ordered']); $location = $this->hrefLink(FILENAME_PRODUCT_INFO, 'products_id=' . $result['pID'], $request_type, false); $location_base = $this->base_url; $lastmod = tep_not_null($result['last_mod']) ? $result['last_mod'] : $result['date_added']; $changefreq = GOOGLE_SITEMAP_IMAGES_CHANGE_FREQ; $ratio = $top > 0 ? $result['products_ordered']/$top : 0; $priority = $ratio < .1 ? .1 : number_format($ratio, 1, '.', ''); if ($lastmod == 0) { $lastmod = date("Y-m-d H:m:s"); } $pimage_query = tep_db_query("SELECT image as pimg FROM products_images WHERE products_id = '" . $result['pID'] . "' ORDER BY sort_order ASC"); $pimg = array(); if (tep_db_num_rows($pimage_query) > 0){ $pimg = ''; while( $pimage = tep_db_fetch_array($pimage_query) ){ $pimg[] = $pimage['pimg']; } } $pre_container = array('loc' => htmlspecialchars(utf8_encode($location)), 'lastmod' => date ("Y-m-d", strtotime($lastmod)), 'changefreq' => $changefreq, 'priority' => $priority, 'img' => htmlspecialchars(utf8_encode($location_base) . 'images/' . $result['img']) ); foreach ($pimg as $key => $val ) { $pre_container['pimg_'.$key] = htmlspecialchars(utf8_encode($location_base) . 'images/' . $val); } $container[] = $pre_container; if ( sizeof($container) >= 50000 ){ $type = $number == 0 ? 'images' : 'images' . $number; $this->GenerateSitemapImages($container, $type); $container = array(); $number++; } } # end while tep_db_free_result($products_query); if ( sizeof($container) > 0 ) { $type = $number == 0 ? 'images' : 'images' . $number; return $this->GenerateSitemapImages($container, $type); } # end if } else { $this->debug['QUERY']['IMAGES']['STATUS'] = 'false'; $this->debug['QUERY']['IMAGES']['NUM_ROWS'] = '0'; } } # end function
    2a. Find at line 505 :
    function GenerateSitemapImages($data, $file){ $content = '<?xml version="1.0" encoding="UTF-8"?>' . "\n"; $content .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"' . "\n"; $content .= 'xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">' . "\n"; foreach ($data as $url){ $content .= "\t" . '<url>' . "\n"; $content .= "\t\t" . '<loc>'.$url['loc'].'</loc>' . "\n"; $content .= "\t\t" . '<image:image>' . "\n"; $content .= "\t\t" . '<image:loc>' . $url['img'] . '</image:loc>' . "\n"; $content .= "\t\t" . '</image:image>' . "\n"; $content .= "\t\t" . '<lastmod>'.$url['lastmod'].'</lastmod>' . "\n"; $content .= "\t\t" . '<changefreq>'.$url['changefreq'].'</changefreq>' . "\n"; $content .= "\t\t" . '<priority>'.$url['priority'].'</priority>' . "\n"; $content .= "\t" . '</url>' . "\n"; } # end foreach $content .= '</urlset>'; return $this->SaveFile($content, $file); } # end function 2b. Replace with :
    function GenerateSitemapImages($data, $file){ $content = '<?xml version="1.0" encoding="UTF-8"?>' . "\n"; $content .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"' . "\n"; $content .= 'xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">' . "\n"; foreach ($data as $url){ $content .= "\t" . '<url>' . "\n"; $content .= "\t\t" . '<loc>'.$url['loc'].'</loc>' . "\n"; foreach ($url as $key => $val) { switch(substr($key,0,5)) { case "img": case "pimg_": $content .= "\t\t" . '<image:image>' . "\n"; $content .= "\t\t" . '<image:loc>' . $val . '</image:loc>' . "\n"; $content .= "\t\t" . '</image:image>' . "\n"; break; } } # end foreach $content .= "\t\t" . '<lastmod>'.$url['lastmod'].'</lastmod>' . "\n"; $content .= "\t\t" . '<changefreq>'.$url['changefreq'].'</changefreq>' . "\n"; $content .= "\t\t" . '<priority>'.$url['priority'].'</priority>' . "\n"; $content .= "\t" . '</url>' . "\n"; } # end foreach $content .= '</urlset>'; return $this->SaveFile($content, $file); } # end function Enjoy !


     
  14. Like
    milerwan got a reaction from raiwa in Country State Selector BS v3.0   
    New update : https://apps.oscommerce.com/UT1CL&country-state-selector-bs

    Country State BS v3.0.1 - milerwan
    Apply name changes for module and files (from 2.4.5 by Demitry) as "jQuery" library is not use in this module (and therefore replaced by "Selector" to match the real name of the module) :
    - Country/State jQuery -> Country/State Selector
    - ht_country_state_jquery.php -> ht_country_state_selector.php
    Cleaning some unnecessary codes into states.php file
    Change icon "refresh" to "spinner" for better look with a new line adjustment (includes/modules/ht_country_state_selector.php)
    Add fontawesome 5 compatibility for users of new 2.3.4.1 CE Frozen version and/or fontawesome 5 library in their "classic" 2.3.4 BS shop (separated folder to copy to overwrite "includes/modules/ht_country_state_selector.php" file
  15. Like
    milerwan got a reaction from ce7 in NEW! Complete Order Editing Tool!   
    @@Dan Cole
     
    It's ok, I found the way to have correct calculating of "ot_total_ht" value ($order->info['total_ht']).
     
    In "edit_orders.php" and "edit_order_ajax.php" files, add these new occurences between -> // Add ot_total_ht :
    if ($ot_title != '') { //7 // Add ot_total_ht if ($order_totals[$i]['code'] != 'ot_total_ht') { // Add ot_total_ht $new_order_totals[] = array('title' => $ot_title, 'text' => (($ot_class != 'ot_total') ? $order_totals[$i]['text'] : '<b>' . $currencies->format($order->info['total'], true, $order->info['currency'], $order->info['currency_value']) . '</b>'), 'value' => (($order_totals[$i]['code'] != 'ot_total') ? $order_totals[$i]['value'] : $order->info['total']), 'code' => $order_totals[$i]['code'], // 'sort_order' => $j); 'sort_order' => ((array_key_exists($order_totals[$i]['code'], $sort_order)) ? $sort_order[$order_totals[$i]['code']] : $j)); // Add ot_total_ht } else { $new_order_totals[] = array('title' => $ot_title, 'text' => $currencies->format($order->info['total_ht'], true, $order->info['currency'], $order->info['currency_value']), 'value' => $order->info['total_ht'], 'code' => 'ot_total_ht', // 'sort_order' => $j); 'sort_order' => ((array_key_exists($order_totals[$i]['code'], $sort_order)) ? $sort_order[$order_totals[$i]['code']] : $j)); } // Add ot_total_ht $written_ot_totals_array[] = $ot_class; $written_ot_titles_array[] = $ot_title; $j++; } else { //within 7 And a little lower :
    $new_order_totals[] = array('title' => $ot_title, 'text' => $currencies->format($ot_value, true, $order->info['currency'], $order->info['currency_value']), 'value' => $ot_value, // Add ot_discount // 'code' => 'ot_custom_' . $j, 'code' => 'ot_discount', // Add ot_discount // 'sort_order' => $j); 'sort_order' => ((array_key_exists($order_totals[$i]['code'], $sort_order)) ? $sort_order[$order_totals[$i]['code']] : $j)); $order->info['total'] += $ot_value; // Add ot_total_ht reset($order->info['tax_groups']); while (list($key, $value) = each($order->info['tax_groups'])) { if ($value != '') { $order->info['total_ht'] -= $tax_to_add - $ot_value; } else { $order->info['total_ht'] += $ot_value; } } // Add ot_total_ht $written_ot_totals_array[] = $ot_class; $written_ot_titles_array[] = $ot_title; $j++; } //end 3 Now "ot_total_ht" class is fully supported under Order Editor.  :thumbsup:
  16. Like
    milerwan got a reaction from Dan Cole in NEW! Complete Order Editing Tool!   
    To add tax to "ot_custom" class (or "ot_discount" if replace by it), you have to edit "admin/edit_orders.php" and modify like this :
     
     
    1. Line 499 :
    tep_db_query("DELETE FROM " . TABLE_ORDERS_TOTAL . " WHERE orders_id = '" . (int)$oID . "'"); $j=1; //giving something a sort order of 0 ain't my bag baby $new_order_totals = array(); // Add tax to ot_custom bof $tax_to_add=0; // Add tax to ot_custom eof if (is_array($_POST['update_totals'])) { //1 foreach($_POST['update_totals'] as $total_index => $total_details) { //2 2. Line 517 :
    if ( ( ($order_totals[$i]['code'] == 'ot_tax') && ($order_totals[$i]['code'] == $ot_class) && ($order_totals[$i]['title'] == $ot_title) ) || ( ($order_totals[$i]['code'] != 'ot_tax') && ($order_totals[$i]['code'] == $ot_class) ) ) { //6 //only good for components that show up in the $order_totals array // Add tax to ot_custom bof if ($order_totals[$i]['code'] == 'ot_tax') { $order_totals[$i]['value'] += $tax_to_add; $order_totals[$i]['text'] = $currencies->format($order_totals[$i]['value'], true, $order->info['currency'], $order->info['currency_value']); } // Add tax to ot_custom eof if ($ot_title != '') { //7 3. Line 562 :
    } elseif ( (tep_not_null($ot_value)) && (tep_not_null($ot_title)) ) { // this modifies if (!strstr($ot_class, 'ot_custom')) { //3 // Add tax to ot_custom bof //This calculates tax on ot_custom $tax_to_add += $ot_value * $tax / (100 + $tax); // Add tax to ot_custom eof $new_order_totals[] = array('title' => $ot_title, 'text' => $currencies->format($ot_value, true, $order->info['currency'], $order->info['currency_value']), 4. Line 577 :
    //save ot_skippy from certain annihilation if ( (!in_array($ot_class, $written_ot_totals_array)) && (!in_array($ot_title, $written_ot_titles_array)) && (tep_not_null($ot_value)) && (tep_not_null($ot_title)) && ($ot_class != 'ot_tax') && ($ot_class != 'ot_loworderfee') ) { //7 //this is supposed to catch the oddball components that don't show up in $order_totals $new_order_totals[] = array( 'title' => $ot_title, 'text' => $currencies->format($ot_value, true, $order->info['currency'], $order->info['currency_value']), 'value' => $ot_value, 'code' => $ot_class, 'sort_order' => $j); //$current_ot_totals_array[] = $order_totals[$i]['code']; //$current_ot_titles_array[] = $order_totals[$i]['title']; $written_ot_totals_array[] = $ot_class; $written_ot_titles_array[] = $ot_title; // Add tax to ot_custom bof //This calculates tax on non-standard $tax_to_add += $ot_value * $tax / (100 + $tax); $order->info['total'] += $ot_value; // Add tax to ot_custom eof $j++; } //end 7 } //end 2
  17. Like
    milerwan reacted to raiwa in QTPro BS   
    @@milerwan, @@LeeFoster,
     
    I'll try to have a look on this when I'll find some time. Please be patient.
     
    rgds
    Rainer
  18. Like
    milerwan got a reaction from ArtcoInc in Specifications, reviews and support tabs (Bootstrap)   
    @@Howmessages

    Here is the script to add to the product_info file to have bootstrap nav tabs :
    <div class="contentContainer"> <div class="contentText" <!-- Nav tabs --> <ul class="nav nav-pills" role="tablist"> <li role="presentation" class="active"><a href="#descriptive" aria-controls="descriptive" role="tab" data-toggle="tab"><?php echo TEXT_DESCRIPTIVE; ?></a></li> <?php if (tep_not_null($product_info['products_nav_tabs_text_1'])) { ?> <li role="presentation"><a href="#nav_tabs_1" aria-controls="nav_tabs_1" role="tab" data-toggle="tab"> <?php echo $product_info['products_nav_tabs_title_1']; ?></a></li> <?php } if (tep_not_null($product_info['products_nav_tabs_text_2'])) { ?> <li role="presentation"><a href="#nav_tabs_2" aria-controls="nav_tabs_2" role="tab" data-toggle="tab"> <?php echo $product_info['products_nav_tabs_title_2']; ?></a></li> <?php } ?> <li role="presentation"><a href="#reviews" aria-controls="reviews" role="tab" data-toggle="tab"><?php echo TEXT_REVIEWS; ?></a></li> <?php // also_purchase tab start $orders_query = tep_db_query("select p.products_id, p.products_image, pd.products_name from " . TABLE_ORDERS_PRODUCTS . " opa, " . TABLE_ORDERS_PRODUCTS . " opb, " . TABLE_ORDERS . " o, " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where opa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and opa.orders_id = opb.orders_id and opb.products_id != '" . (int)$HTTP_GET_VARS['products_id'] . "' and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "' group by p.products_id order by o.date_purchased desc limit " . MAX_DISPLAY_ALSO_PURCHASED); $num_products_ordered = tep_db_num_rows($orders_query); if ($num_products_ordered >= MIN_DISPLAY_ALSO_PURCHASED) { ?> <li role="presentation"><a href="#also_purchased" aria-controls="also_purchased" role="tab" data-toggle="tab"><?php echo TEXT_ALSO_PURCHASED; ?></a></li> <?php } // also_purchase tab end ?> </ul> <br> <!-- Tab panes --> <div class="tab-content"> <div role="tabpanel" class="tab-pane active" id="descriptive" itemprop="description"> <?php echo stripslashes($product_info['products_description']); ?> </div> <?php if (tep_not_null($product_info['products_nav_tabs_text_1'])) { ?> <div role="tabpanel" class="tab-pane main" id="nav_tabs_1" itemprop="description"><?php echo $product_info['products_nav_tabs_text_1']; ?></div> <?php } if (tep_not_null($product_info['products_nav_tabs_text_2'])) { ?> <div role="tabpanel" class="tab-pane main" id="nav_tabs_2" itemprop="description"><?php echo $product_info['products_nav_tabs_text_2']; ?></div> <?php } ?> <div role="tabpanel" class="tab-pane" id="reviews"> <!-- début --> <?php $reviews_query_raw = "select r.reviews_id, SUBSTRING_INDEX(rd.reviews_text, ' ', 20) as reviews_text, r.reviews_rating, date(r.date_added) as date_added, c.customers_firstname, c.customers_lastname from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_CUSTOMERS . " c where r.products_id = '" . (int)$product_info['products_id'] . "' and r.reviews_id = rd.reviews_id and r.customers_id = c.customers_id and rd.languages_id = '" . (int)$languages_id . "' and r.reviews_status = 1 order by r.date_added DESC"; $reviews_split = new splitPageResults($reviews_query_raw, '4'); if ($reviews_split->number_of_rows > 0) { ?> <h4><?php echo TEXT_LAST_REVIEWS; ?></h4> <hr> <div class="reviews"> <!-- ADD anonymous reviews --> <?php $reviews_query = tep_db_query($reviews_split->sql_query); while ($reviews = tep_db_fetch_array($reviews_query)) { $review_name = tep_output_string_protected($reviews['customers_firstname'] . ' ' . substr($reviews['customers_lastname'], 0, 1) . '.'); ?> <!-- END anonymous reviews --> <blockquote class="col-sm-6" itemprop="review" itemscope itemtype="http://schema.org/Review"> <p itemprop="reviewBody"><?php echo tep_output_string_protected($reviews['reviews_text']) . ' ...' ?></p> <meta itemprop="datePublished" content="<?php echo $reviews['date_added']; ?>"> <span itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating"> <meta itemprop="ratingValue" content="<?php echo (int)$reviews['reviews_rating']; ?>"></span> <footer><?php echo sprintf(REVIEWS_TEXT_RATED, tep_draw_stars($reviews['reviews_rating']), $review_name, $review_name); ?></footer> <span style="margin-top:5px;" class="pull-right xsmall"><?php echo REVIEWS_TEXT_POSTED . ' ' . tep_date_long($reviews['date_added']); ?></span> </blockquote> <?php } ?> </div> <div class="clearfix"></div> <?php } else { ?> <div class="alert alert-info"> <?php echo TEXT_NO_REVIEWS; ?> </div> <?php } ?> <br> <?php if ($reviews_split->number_of_rows > 0) { ?> <div class="row col-xs-6"><?php echo tep_draw_button(IMAGE_BUTTON_REVIEWS . (($reviews['count'] > 0) ? ' (' . $reviews['count'] . ')' : ''), 'fa fa-commenting', tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params())); ?></div> <?php } else { ?> <div class="row col-xs-6"><?php echo tep_draw_button(IMAGE_BUTTON_WRITE_REVIEW . (($reviews['count'] > 0) ? ' (' . $reviews['count'] . ')' : ''), 'fa fa-commenting', tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params())); ?></a></div> <?php } ?> <div class="clearfix"></div> </div> <!-- fin --> <div role="tabpanel" class="tab-pane main" id="also_purchased"> <?php if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_also_purchased(3600); } else { include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS); } ?> </div> </div> </div> And in admin/categories.php file, you must add/adapt these entries:
    - products_nav_tabs_title_1
    - products_nav_tabs_title_2
    - products_nav_tabs_text_1
    - products_nav_tabs_text_2

    Like this :
    $sql_data_array = array('products_name' => tep_db_prepare_input($HTTP_POST_VARS['products_name'][$language_id]), 'products_description' => tep_db_prepare_input($HTTP_POST_VARS['products_description'][$language_id]), 'products_url' => tep_db_prepare_input($HTTP_POST_VARS['products_url'][$language_id]), // Nav Tabs 'products_nav_tabs_title_1' => tep_db_prepare_input($HTTP_POST_VARS['products_nav_tabs_title_1'][$language_id]), 'products_nav_tabs_title_2' => tep_db_prepare_input($HTTP_POST_VARS['products_nav_tabs_title_2'][$language_id]), 'products_nav_tabs_text_1' => tep_db_prepare_input($HTTP_POST_VARS['products_nav_tabs_text_1'][$language_id]), 'products_nav_tabs_text_2' => tep_db_prepare_input($HTTP_POST_VARS['products_nav_tabs_text_2'][$language_id])); // Nav Tabs and
    $description_query = tep_db_query("select language_id, products_name, products_description, products_nav_tabs_title_1, products_nav_tabs_title_2, products_nav_tabs_text_1, products_nav_tabs_text_2, products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_id . "'"); while ($description = tep_db_fetch_array($description_query)) { tep_db_query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_description, products_nav_tabs_title_1, products_nav_tabs_title_2, products_nav_tabs_text_1, products_nav_tabs_text_2, products_url, products_viewed) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "', '" . tep_db_input($description['products_nav_tabs_title_1']) . "', '" . tep_db_input($description['products_nav_tabs_title_2']) . "', '" . tep_db_input($description['products_nav_tabs_text_1']) . "', '" . tep_db_input($description['products_nav_tabs_text_2']) . "', '" . tep_db_input($description['products_url']) . "', '0')"); } and
    $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_nav_tabs_title_1, pd.products_nav_tabs_title_2, pd.products_nav_tabs_text_1, pd.products_nav_tabs_text_2, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_availability, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'"); and above the textarea  description windows:
    <!-- Nav Tabs --> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td colspan="2" class="main"><hr></td> </tr> <tr> <td colspan="2" class="main"><?php echo TEXT_PRODUCTS_NAV_TABS; ?></td> </tr> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <?php for ($i=0, $n=sizeof($languages); $i<$n; $i++) { ?> <tr> <td colspan="2"><table border="0" cellspacing="0" cellpadding="0"> <tr> <td><table border="0" cellspacing="0" cellpadding="0"><?php echo tep_image(tep_catalog_href_link(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], '', 'SSL'), $languages[$i]['name']) . ' ' . tep_draw_input_field('products_nav_tabs_title_1[' . $languages[$i]['id'] . ']', (empty($pInfo->products_id) ? '' : tep_get_products_nav_tabs_title_1($pInfo->products_id, $languages[$i]['id'])), 'size="30"'); ?></td> <tr> <td class="main" valign="top"><?php echo tep_image(tep_catalog_href_link(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], '', 'SSL'), $languages[$i]['name']); ?> </td> <td class="main"><?php echo tep_draw_textarea_field('products_nav_tabs_text_1[' . $languages[$i]['id'] . ']', 'soft', '60', '4', (isset($products_nav_tabs_text_1[$languages[$i]['id']]) ? stripslashes($products_nav_tabs_text_1[$languages[$i]['id']]) : tep_get_products_nav_tabs_text_1($pInfo->products_id, $languages[$i]['id']))); ?></td> </tr> </table></td> <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '20', '1'); ?></td> <td><table border="0" cellspacing="0" cellpadding="0"><?php echo tep_image(tep_catalog_href_link(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], '', 'SSL'), $languages[$i]['name']) . ' ' . tep_draw_input_field('products_nav_tabs_title_2[' . $languages[$i]['id'] . ']', (empty($pInfo->products_id) ? '' : tep_get_products_nav_tabs_title_2($pInfo->products_id, $languages[$i]['id'])), 'size="30"'); ?></td> <tr> <td class="main" valign="top"><?php echo tep_image(tep_catalog_href_link(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], '', 'SSL'), $languages[$i]['name']); ?> </td> <td class="main"><?php echo tep_draw_textarea_field('products_nav_tabs_text_2[' . $languages[$i]['id'] . ']', 'soft', '60', '4', (isset($products_nav_tabs_text_2[$languages[$i]['id']]) ? stripslashes($products_nav_tabs_text_2[$languages[$i]['id']]) : tep_get_products_nav_tabs_text_2($pInfo->products_id, $languages[$i]['id']))); ?></td> </tr> </table></td> </tr> </table></td> </tr> <?php } ?> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <!-- Nav Tabs --> Finally, you need to create/add in your database / TABLE / "products_description" these entries:
    - products_nav_tabs_title_1   -> Type varchar(32)
    - products_nav_tabs_title_2   -> Type varchar(32)
    - products_nav_tabs_text_1   -> Type text
    - products_nav_tabs_text_2   -> Type text

     
    With these blank entries, you can add for some products specific tabs with their own text.
  19. Like
    milerwan got a reaction from Mikepo in Store Search Bar (BS)   
    @@Mikepo

    With your sentence the search is done into "products_name", "products_model" and "products_seo_keywords" together.
    So the admin choice between "Model/Keyword" is no longer active.

    Otherwise, in keywords, you could input the real manufacturer model of the product, it will be more interesting than the osc model of the product.
  20. Like
    milerwan got a reaction from shoshoni in Store Search Bar (BS)   
    @@shoshoni

    Yes it's normal.
    ​There is no display of category image because this would be confusing with listing of products.
  21. Like
    milerwan got a reaction from shoshoni in Store Search Bar (BS)   
    Hi,
    You have to go in the admin, modules->content->Store Search Bar, and check infobox for Image display :
     
    Display Image or Icon for Product Search Result
    Do you want to display product image or cart icon for product result?
     
     x Image
     o Icon
     
    But this option is enable by default so if you haven't picture for products from dropdown maybe you haven't installed the right version :
    Store Search with Image (BS) : http://addons.oscommerce.com/info/9504
  22. Like
    milerwan got a reaction from Mikepo in Store Search Bar (BS)   
    I have find a bug in the html transcription of the character "&" in the generated URL from this code in content_search.php :
    'title' => MODULE_CONTENT_HEADER_STORE_SEARCH_MORE_PRODUCT, 'href' => tep_href_link('advanced_search_result.php', 'keywords=' . urlencode(str_replace(' ', ' ', $query)) . '&search_in_description=' . (MODULE_CONTENT_HEADER_STORE_SEARCH_FUNCTIONS == 'Descriptions' ? 1 : 0), $request_type), 'price' => null); The "&" character is translated by "&".
     
    For exemple, if you make a search of "m" product and click the "View more products on search page..." link, the link generated will be this one :
     
    xxx/advanced_search_result.php?keywords=m&search_in_description=1
     
    instead of 
     
    xxx/advanced_search_result.php?keywords=m&search_in_description=1
     
    Without right transcription of "&" character, the search in description can't work in that case.
     
    So I have modified the code like this to make it works :
    'href' => tep_href_link('advanced_search_result.php', 'keywords=' . urlencode(str_replace(' ', ' ', $query)), $request_type) . '&search_in_description=' . (MODULE_CONTENT_HEADER_STORE_SEARCH_FUNCTIONS == 'Descriptions' ? 1 : 0), This bug comes from v1.1 of Store Search...
    The newest version 1.4 is available in download from yesterday : http://addons.oscommerce.com/info/9504
  23. Like
    milerwan got a reaction from ArtcoInc in Store Search Bar (BS)   
    I finally remove the faulty display of categories and add an image of the product instead of "cart" icon (see attached picture).
     
    Thank you to let me know if this feature sounds interesting.
    At that time, I'll post an update of the contribution. :)

×
×
  • Create New...