Jump to content
Latest News: (loading..)

Leaderboard


Popular Content

Showing content with the highest reputation on 01/04/2019 in all areas

  1. 2 points
    burt

    28d, 2019 - Pre Orders are now open

    Hello all, pre-orders are now open for my next 28d package of mods. Those who pre-order get the whole package of mods at a cut-down price compared to those who wait until February. I have a demo site up and running, showcasing the mods that I have coded so far. If anyone is interested in taking a look at Demo site (without obligation to pre-order, though I hope you will), please PM me. 2019 will hopefully be a year of change for osCommerce, and as I am the only developer keeping osCommerce somewhat relevant ... I hope that everyone will take the opportunity to show their support. Thank You.
  2. 2 points
    raiwa

    [Contribution] Ship In Cart

    Update uploaded: Ship In Cart BS reloaded 4.4. Changes Vers. 4.4: - Fixed shipping method selection if only one module with several methods installed. Thanks to @kanhsu
  3. 1 point
    John W

    Cezpdf pdf-php creator

    I don't know if anyone will have interest in this, so I won't spend a lot of time on this unless it gains traction. Anyway, I use batch print from over a decade ago and didn't realize until yesterday that the pdf class was still being maintained. Since I only sell in the US, I haven't run into many character encoding problems, but I imagine some of you do. So, the new version of Cezpdf seems to work with all the characters. It's also php 7.2 compliant. Even better, I was able to replace my old Cezpdf and Cpdf class files and associated files. With very little changes, it prints my invoice. The pdf manual seems pretty useful, but I haven't gone very far into it yet. The main snag I hit was using "addTextWrap", which requires a different order than before. But, it has more functionality, so I can right justify for totals, which I couldn't do before. addText also has changed. I only have a few hours into it, but check the manual out. So, I said wouldn't ramble too much. If anyone is intersted you can find it at https://github.com/rospdf/pdf-php
  4. 1 point
    kanhsu

    [Contribution] Ship In Cart

    Hi @raiwa, Work like a charm, thanks for the help. For anyone who want to change the look of the 'ugly' radio button to a responsive button, here is my code and css. You can adapt it to probably any radio field if you are technical. a<?php /* $Id: cm_sc_shipping.php $Loc: catalog/includes/modules/content/shopping_cart/ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Shipping Estimator 4.3 BS by @raiwa info@oscaddons.com www.oscaddons.com Original version: Edwin Bekaert (edwin@ednique.com) Justin Baldwin Linda McGrath (osCommerce@WebMakers.com) Copyright (c) 2016 osCommerce Released under the GNU General Public License */ class cm_sc_shipping { var $code; var $group; var $title; var $description; var $sort_order; var $enabled = false; function __construct() { $this->code = get_class($this); $this->group = basename(dirname(__FILE__)); $this->title = MODULE_CONTENT_SC_SHIPPING_TITLE; $this->description = MODULE_CONTENT_SC_SHIPPING_DESCRIPTION; $this->description .= '<div class="secWarning">' . MODULE_CONTENT_BOOTSTRAP_ROW_DESCRIPTION . '</div>'; if ( defined('MODULE_CONTENT_SC_SHIPPING_STATUS') ) { $this->sort_order = MODULE_CONTENT_SC_SHIPPING_SORT_ORDER; $this->enabled = (MODULE_CONTENT_SC_SHIPPING_STATUS == 'True'); } } function execute() { global $oscTemplate, $currencies, $currency, $request_type, $cart, $order, $total_count, $quotes, $method, $module, $shipping, $navigation, $cart_sid, $cart_country_id, $cart_zone, $cart_zip_code, $cart_address_id, $total_weight, $language, $customer_id, $sendto, $billto; $content_width = (int)MODULE_CONTENT_SC_SHIPPING_CONTENT_WIDTH; if (($cart->count_contents() > 0)) { $selected_shipping = null; // include the order class (uses the sendto !) if (!class_exists('order')) { require('includes/classes/order.php'); } $order = new order; if (tep_session_is_registered('customer_id')) { // user is logged in if (isset($_POST['address_id'])){ // user changed address $order->delivery = array(); $sendto = $_POST['address_id']; $addresses_query = tep_db_query("select address_book_id, entry_firstname as firstname, entry_lastname as lastname, entry_company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from address_book where customers_id = '" . $customer_id . "' and address_book_id = '" . $sendto . "'"); $addresses_array_changed = tep_db_fetch_array($addresses_query); $country_info = tep_get_countries($addresses_array_changed['country_id'],true); $order->delivery = array('name' => $addresses_array_changed['firstname'] . ' ' . $addresses_array_changed['lastname'], 'company' => $addresses_array_changed['entry_company'], 'street_address' => $addresses_array_changed['street_address'], 'postcode' => $addresses_array_changed['postcode'], 'suburb' => $addresses_array_changed['suburb'], 'city' => $addresses_array_changed['city'], 'country' => array('id' => $addresses_array_changed['country_id'], 'title' => $country_info['countries_name'], 'iso_code_2' => $country_info['countries_iso_code_2'], 'iso_code_3' => $country_info['countries_iso_code_3']), 'country_id' => $addresses_array_changed['country_id'], 'state' => $addresses_array_changed['state'], 'zone_id' => $addresses_array_changed['zone_id'], 'format_id' => tep_get_address_format_id($addresses_array_changed['country_id'])); } elseif ( !tep_session_is_registered('sendto') ) { if ( tep_session_is_registered('cart_address_id') ) { // user once changed address $sendto = (isset($_POST['cart_address_id'])? $_POST['cart_address_id'] : null); } else { // first timer $sendto = (isset($_POST['customer_default_address_id'])? $_POST['customer_default_address_id'] : null); } } // set session now $cart_address_id = $sendto; tep_session_register('sendto'); tep_session_register('cart_address_id'); // set shipping to null ! multipickup changes address to store address... $shipping=''; } else { // user not logged in ! if ( isset($_POST['country_id']) ) { // country is selected $country_info = tep_get_countries($_POST['country_id'],true); $cache_state_prov_values = tep_db_fetch_array(tep_db_query("select zone_code from zones where zone_country_id = '" . $_POST['country_id'] . "' and zone_id = '" . $_POST['zone_id'] . "'")); $cache_state_prov_code = $cache_state_prov_values['zone_code']; $order->delivery = array(); $order->delivery = array('postcode' => (isset($_POST['zip_code'])? $_POST['zip_code'] : null), 'state' => $cache_state_prov_code, 'country' => array('id' => $_POST['country_id'], 'title' => $country_info['countries_name'], 'iso_code_2' => $country_info['countries_iso_code_2'], 'iso_code_3' => $country_info['countries_iso_code_3']), 'country_id' => $_POST['country_id'], //add state zone_id 'zone_id' => $_POST['zone_id'], 'format_id' => tep_get_address_format_id($_POST['country_id'])); $cart_country_id = $_POST['country_id']; tep_session_register('cart_country_id'); //add state zone_id $cart_zone = isset($_POST['zone_id'])? $_POST['zone_id'] : null; tep_session_register('cart_zone'); $cart_zip_code = (isset($_POST['zip_code'])? $_POST['zip_code'] : null); tep_session_register('cart_zip_code'); } elseif ( tep_session_is_registered('cart_country_id') ) { // session is available $country_info = tep_get_countries($cart_country_id,true); $order->delivery = array(); $order->delivery = array('postcode' => $cart_zip_code, 'country' => array('id' => $cart_country_id, 'title' => $country_info['countries_name'], 'iso_code_2' => $country_info['countries_iso_code_2'], 'iso_code_3' => $country_info['countries_iso_code_3']), 'country_id' => $cart_country_id, 'format_id' => tep_get_address_format_id($cart_country_id), 'zone_id' => $cart_zone); } else { // first timer $cart_country_id = STORE_COUNTRY; $cart_zone = STORE_ZONE; $cart_zip_code = MODULE_CONTENT_SC_SHIPPING_DEFAULT_ZIP; tep_session_register('cart_country_id'); tep_session_register('cart_zone'); tep_session_register('cart_zip_code'); $country_info = tep_get_countries(STORE_COUNTRY,true); $order->delivery = array(); $order->delivery = array('postcode' => MODULE_CONTENT_SC_SHIPPING_DEFAULT_ZIP, 'country' => array('id' => STORE_COUNTRY, 'title' => $country_info['countries_name'], 'iso_code_2' => $country_info['countries_iso_code_2'], 'iso_code_3' => $country_info['countries_iso_code_3']), 'country_id' => STORE_COUNTRY, 'format_id' => tep_get_address_format_id($cart_country_id), 'zone_id' => STORE_ZONE); } // set the cost to be able to calculate free shipping $order->info = array('total' => $cart->show_total(), // TAX ???? 'currency' => $currency, 'currency_value'=> $currencies->currencies[$currency]['value']); } // weight and count needed for shipping $total_weight = $cart->show_weight(); $total_count = $cart->count_contents(); require('includes/classes/shipping.php'); $shipping_modules = new shipping; $quotes = $shipping_modules->quote(); $order->info['subtotal'] = $cart->total; // set selections for displaying $selected_country = $order->delivery['country']['id']; $selected_address = $sendto; // eo shipping cost // check free shipping based on order total if ( defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') ) { switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) { case 'national': if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break; case 'international': if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break; case 'both': $pass = true; break; default: $pass = false; break; } $free_shipping = false; if ( ($pass == true) && ($order->info['total'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) { $free_shipping = true; include('includes/languages/' . $language . '/modules/order_total/ot_shipping.php'); } } else { $free_shipping = false; } // begin shipping cost if( !$free_shipping && $cart->get_content_type() !== 'virtual' ) { if (isset($_POST['sid']) && tep_not_null($_POST['sid'])){ list($module, $method) = explode('_', $_POST['sid']); $cart_sid = $_POST['sid']; tep_session_register('cart_sid'); } elseif ( tep_session_is_registered('cart_sid') ) { list($module, $method) = explode('_', $cart_sid); } else { $module = null; $method = null; } if ( tep_not_null($module) && tep_not_null($shipping_modules->quote($method, $module)) ) { $selected_quote = $shipping_modules->quote($method, $module); if( isset($selected_quote[0]['error'])) { $selected_shipping = $shipping_modules->cheapest(); $order->info['shipping_method'] = $selected_shipping['title']; $order->info['shipping_cost'] = $selected_shipping['cost']; $order->info['total']+= $selected_shipping['cost']; } else { $order->info['shipping_method'] = $selected_quote[0]['module'] . (tep_not_null($selected_quote[0]['methods'][0]['title'])? ' (' . $selected_quote[0]['methods'][0]['title'] . ')': '' ); $order->info['shipping_cost'] = $selected_quote[0]['methods'][0]['cost']; $order->info['total']+= $selected_quote[0]['methods'][0]['cost']; $selected_shipping['title'] = $order->info['shipping_method']; $selected_shipping['cost'] = $order->info['shipping_cost']; $selected_shipping['id'] = $selected_quote[0]['id'].'_'.$selected_quote[0]['methods'][0]['id']; } } else { $selected_shipping = $shipping_modules->cheapest(); $order->info['shipping_method'] = $selected_shipping['title']; $order->info['shipping_cost'] = $selected_shipping['cost']; $order->info['total']+= $selected_shipping['cost']; } } // virtual products use free shipping if ( $cart->get_content_type() == 'virtual' ) { $order->info['shipping_method'] = MODULE_CONTENT_SC_SHIPPING_SHIPPING_METHOD_FREE_TEXT . ' ' . MODULE_CONTENT_SC_SHIPPING_SHIPPING_METHOD_ALL_DOWNLOADS; $order->info['shipping_cost'] = 0; } if ( $free_shipping ) { $order->info['shipping_method'] = MODULE_ORDER_TOTAL_SHIPPING_TITLE; $order->info['shipping_cost'] = 0; } $shipping = $selected_shipping; if (!tep_session_is_registered('shipping')) tep_session_register('shipping'); // end of shipping cost // end free shipping based on order total $sc_order_shipping = '<div class="panel panel-default">'; $sc_order_shipping .= ' <div class="panel-heading">'; $sc_order_shipping .= ' <h3 class="panel-title">' . MODULE_CONTENT_SC_SHIPPING_MODULE_TITLE . '</h3>'; // BS panel heading $sc_order_shipping .= ' </div>'; $sc_order_shipping .= ' <div class="panel-body">'; $sc_order_shipping .= tep_draw_form('estimator', tep_href_link('shopping_cart.php', '', 'NONSSL'), 'post'); //'onSubmit="return check_form();"' $sc_order_shipping .= tep_draw_hidden_field('sid', $selected_shipping['id']); $sc_order_shipping .= ' <div class="row">'; if ( tep_session_is_registered('customer_id') ) { // logged in if ( MODULE_CONTENT_SC_SHIPPING_SHOWWT == 'True' ) { $showweight = '&nbsp;(' . $total_weight . '&nbsp;' . MODULE_CONTENT_SC_SHIPPING_WTUNIT . ')'; } if ( MODULE_CONTENT_SC_SHIPPING_SHOWIC == 'True' ) { $sc_order_shipping .= '<div class="col-sm-12">' . ($total_count == 1 ? ' <strong>' . MODULE_CONTENT_SC_SHIPPING_ITEM . '</strong>' : ' <strong>' . MODULE_CONTENT_SC_SHIPPING_ITEM . '</strong>') . '&nbsp;' . $total_count . ((isset($showweight))? $showweight : '') . '</div>'; } if ( $cart->get_content_type() != 'virtual' ) { $addresses_query = tep_db_query("select distinct address_book_id, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from address_book where customers_id = '" . $customer_id . "'"); // only display addresses if more than 1 if ( tep_db_num_rows($addresses_query) > 1 ) { while ( $addresses = tep_db_fetch_array($addresses_query) ) { $addresses_array[] = array('id' => $addresses['address_book_id'], 'text' => tep_address_format(tep_get_address_format_id($addresses['country_id']), $addresses, 0, ' ', ' ')); } $sc_order_shipping .= '<div class="col-sm-2 estimator-padding">' . MODULE_CONTENT_SC_SHIPPING_SHIPPING_METHOD_ADDRESS . '</div><div class="col-sm-10 estimator-padding">'. tep_draw_pull_down_menu('address_id', $addresses_array, $selected_address, 'onchange="return shipincart_submit(\'\');"') . '</div>'; } $sc_order_shipping .= '<div class="clearfix"></div>'; $sc_order_shipping .= '<div class="col-sm-2 estimator-padding"><strong>' . MODULE_CONTENT_SC_SHIPPING_SHIPPING_METHOD_TO .'</strong>' . '</div><div class="col-sm-6 estimator-padding">'. tep_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br>') . '</div><div class="col-sm-4 estimator-padding text-right">'. tep_draw_button(IMAGE_BUTTON_ADD_ADDRESS, 'fa fa-envelope', tep_href_link('checkout_shipping_address.php', '', 'SSL'), NULL, NULL, 'btn btn-info btn-xs' ) . '</div>'; } } else { // not logged in $navigation->set_snapshot(); $sc_order_shipping .= '<div class="col-sm-12">' . MODULE_CONTENT_SC_SHIPPING_SHIPPING_OPTIONS_LOGIN . tep_draw_button(MODULE_CONTENT_SC_SHIPPING_BUTTON_LOGIN, 'glyphicon glyphicon-log-in', tep_href_link('login.php'), 'btn-success btn-sm') . '</div>'; if( MODULE_CONTENT_SC_SHIPPING_SHOWIC == 'True' ) { $sc_order_shipping .= '<div class="col-sm-12 estimator-padding">' . ($total_count == 1 ? ' <strong>' . MODULE_CONTENT_SC_SHIPPING_ITEM . '</strong>' : ' <strong>' . MODULE_CONTENT_SC_SHIPPING_ITEM . '</strong>') . '&nbsp;' . $total_count . ((isset($showweight))? $showweight : '') . '</div>'; } if ( $cart->get_content_type() != 'virtual' ) { if ( MODULE_CONTENT_SC_SHIPPING_SHOWCDD == 'True' ) { $sc_order_shipping.= '<div class="form-group has-feedback">'; if ( MODULE_CONTENT_SC_SHIPPING_SHOWSDD == 'True' || MODULE_CONTENT_SC_SHIPPING_SHOWZDD == 'True' ) { $sc_order_shipping.= '<label for="inputCountry" class="control-label col-sm-4">' . ENTRY_COUNTRY . '</label>'; } else { $sc_order_shipping.= '<label for="inputCountry" class="control-label col-sm-4">' . ENTRY_COUNTRY . '</label>'; } $sc_order_shipping.= '<div class="col-sm-8">' . tep_get_country_list('country_id', $selected_country, 'id="inputCountry"') . '</div>'; $sc_order_shipping.= '</div>'; } else { $sc_order_shipping.= tep_draw_hidden_field('country_id', STORE_COUNTRY); } //add state zone_id $state_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT); $state_query = tep_db_query("select zone_name, zone_id from zones where zone_country_id = '$selected_country' order by zone_country_id DESC, zone_name"); while ( $state_values = tep_db_fetch_array($state_query) ) { $state_array[] = array('id' => $state_values['zone_id'], 'text' => $state_values['zone_name']); } if ( MODULE_CONTENT_SC_SHIPPING_SHOWSDD == 'True' && count($state_array) > 1) { $sc_order_shipping.= '<div class="form-group has-feedback">'; $sc_order_shipping.= '<label for="inputState" class="control-label col-sm-4">' . ENTRY_STATE . '</label>'; $sc_order_shipping.= '<div class="col-sm-8">' . tep_draw_pull_down_menu('zone_id', $state_array, (isset($_POST['zone_id'])? $_POST['zone_id'] : STORE_ZONE), 'id="inputState"') . '</div>'; $sc_order_shipping.= '</div>'; } else { $sc_order_shipping.= tep_draw_hidden_field('zone_id', STORE_ZONE); } if ( MODULE_CONTENT_SC_SHIPPING_SHOWZDD == 'True' ) { $sc_order_shipping.= '<div class="form-group has-feedback">'; $sc_order_shipping.= '<label for="inputZip" class="control-label col-sm-4">' . ENTRY_POST_CODE . '</label>'; $sc_order_shipping.= '<div class="col-sm-4">' . tep_draw_input_field('zip_code', (isset($_POST['zip_code'])? $_POST['zip_code'] : MODULE_CONTENT_SC_SHIPPING_DEFAULT_ZIP), 'id="inputZip"', 'text', true, 'class="form-control" style="width: 125px;"') . '</div>'; $sc_order_shipping.= '</div>'; if ( MODULE_CONTENT_SC_SHIPPING_SHOWUB == 'True' ) { $sc_order_shipping.='<div class="col-sm-4 text-right"><a class="btn btn-default" role="button" href="_" onclick="return shipincart_submit(\'\');"><i class="glyphicon glyphicon-refresh"></i>&nbsp;'. IMAGE_BUTTON_UPDATE . ' </a></div>'; } } else { if ( MODULE_CONTENT_SC_SHIPPING_SHOWUB == 'True' ) { $sc_order_shipping.='<div class="col-sm-12 text-right"><a class="btn btn-default" role="button" href="_" onclick="return shipincart_submit(\'\');"><i class="glyphicon glyphicon-refresh"></i>&nbsp;'. IMAGE_BUTTON_UPDATE . ' </a></div>'; } } } } $sc_order_shipping .= ' </div><br>'; $sc_order_shipping .= ' <div class="shippingradio">'; $sc_order_shipping .= ' <table class="table table-condensed table-hover"'; $at_least_one_quote_printed = false; if ( $cart->get_content_type() == 'virtual' ) { // virtual product-download $sc_order_shipping .= '<tr><td><i>' . MODULE_CONTENT_SC_SHIPPING_SHIPPING_METHOD_FREE_TEXT . ' ' . MODULE_CONTENT_SC_SHIPPING_SHIPPING_METHOD_ALL_DOWNLOADS . '</i></td></tr>'; $at_least_one_quote_printed = true; } elseif ( $free_shipping==1 ) { // order $total is free $sc_order_shipping.='<tr><td><i>' . sprintf(FREE_SHIPPING_DESCRIPTION, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) . '</i></td></tr>'; } else { // shipping display if ( empty($quotes[0]['error']) || (!empty($quotes[1])&&empty($quotes[1]['error'])) ) { // added to Display Message when No Shipping Options are Available $at_least_one_quote_printed = false; } else { $sc_order_shipping .= '<tr><td>&nbsp;</td></tr>'; } $sc_order_shipping .= ' <tbody>'; if ( sizeof($quotes) ) { for ( $i=0, $n=sizeof($quotes); $i<$n; $i++ ) { if ( isset($quotes[$i]['methods']) && sizeof($quotes[$i]['methods'])==1 ) { // simple shipping method $thisquoteid = $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][0]['id']; $sc_order_shipping .= ''; if ( !empty($quotes[$i]['error']) ) { $sc_order_shipping .= '<tr><td>' . $quotes[$i]['module'] . '&nbsp;(' . $quotes[$i]['error'] . ')</td></tr>'; } else { if ( $selected_shipping['id'] == $thisquoteid) { $sc_order_shipping.='<tr class="success col-sm-6"><td class="col-sm-6" style="background-color:#fff;border-width: 2px" onclick="return shipincart_submit(\''.$thisquoteid.'\');">'; $sc_order_shipping.='<label class="RadioContainer">' . tep_draw_radio_field('', true, true) . '<a href="_" title="' . MODULE_CONTENT_SC_SHIPPING_SELECT_THIS_METHOD .'">&nbsp;<strong>' . $quotes[$i]['module'] . '</strong></a>'; $sc_order_shipping.= (isset($quotes[$i]['icon']) && tep_not_null($quotes[$i]['icon']))? $quotes[$i]['icon'] : ''; $sc_order_shipping.= (tep_not_null($quotes[$i]['methods'][0]['title'])? '<div class="shippingcontent help-block"><hr>' . $quotes[$i]['methods'][0]['title'] . '<hr></div>': '' ); $sc_order_shipping.= '<div class="shippingamount"><span>' . $currencies->format(tep_add_tax($quotes[$i]['methods'][0]['cost'], ((!empty($quotes[$i]['tax']))? $quotes[$i]['tax'] : null ))) . '</span></div><span class="RadioCheckmark"></span></label></td></tr>'; } else { $sc_order_shipping.= '<tr class="col-sm-6"><td class="col-sm-6" style="background-color:#fff;border-width: 2px" onclick="return shipincart_submit(\''.$thisquoteid.'\');">' ; $sc_order_shipping.= '<label class="RadioContainer">'. tep_draw_radio_field('', false, false) . '<a href="_" title="' . MODULE_CONTENT_SC_SHIPPING_SELECT_THIS_METHOD . '">&nbsp;' . $quotes[$i]['module'] . '</a>'; $sc_order_shipping.= (isset($quotes[$i]['icon']) && tep_not_null($quotes[$i]['icon']))? $quotes[$i]['icon'] : ''; $sc_order_shipping.= (tep_not_null($quotes[$i]['methods'][0]['title'])? '<div class="shippingcontent help-block"><hr>' . $quotes[$i]['methods'][0]['title'] . '<hr></div>': '' ); $sc_order_shipping.= '<div class="shippingamount"><span>' . $currencies->format(tep_add_tax($quotes[$i]['methods'][0]['cost'], ((!empty($quotes[$i]['tax']))? $quotes[$i]['tax'] : null ))) . '</span></div><span class="RadioCheckmark"></span></label></td></tr>'; } } // added to Display Message when No Shipping Options are Available $at_least_one_quote_printed = true; } elseif ( isset($quotes[$i]['methods']) && sizeof($quotes[$i]['methods'])>1 ) { // shipping method with sub methods (multipickup) for ( $j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++ ) { $thisquoteid = $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id']; $sc_order_shipping .= ''; if ( isset($quotes[$i]['error']) && $quotes[$i]['error'] == true ) { $sc_order_shipping .= '<tr><td>' . $quotes[$i]['module'] . '&nbsp;(' . $quotes[$i]['error'] . ')</td></tr>'; } else { if ( $selected_shipping['id'] == $thisquoteid ) { $sc_order_shipping.= '<tr class="success col-sm-6"><td class="col-sm-6" style="background-color:#fff;border-width: 2px" onclick="return shipincart_submit(\''.$thisquoteid.'\');">' ; $sc_order_shipping.= '<label class="RadioContainer">'. tep_draw_radio_field('', true, true) . '<a href="_" title="' . MODULE_CONTENT_SC_SHIPPING_SELECT_THIS_METHOD .'"><strong>' . $quotes[$i]['module'] . '</strong></a>'; $sc_order_shipping.= (isset($quotes[$i]['icon']) && tep_not_null($quotes[$i]['icon']))? $quotes[$i]['icon'] : ''; $sc_order_shipping.= (tep_not_null($quotes[$i]['methods'][$j]['title'])? '<div class="shippingcontent help-block"><hr>' . $quotes[$i]['methods'][$j]['title'] . '<hr></div>': '' ); $sc_order_shipping.= '<div class="shippingamount"><span>' . $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], ((!empty($quotes[$i]['tax']))? $quotes[$i]['tax'] : null ))) . '</span></div><span class="RadioCheckmark"></span></label></td></tr>'; } else { $sc_order_shipping.= '<tr class="col-sm-6"><td class="col-sm-6" style="background-color:#fff;border-width: 2px" onclick="return shipincart_submit(\''.$thisquoteid.'\');">'; $sc_order_shipping.= '<label class="RadioContainer">'. tep_draw_radio_field('', false, false) . '<a href="_" title="' . MODULE_CONTENT_SC_SHIPPING_SELECT_THIS_METHOD . '">' . $quotes[$i]['module'] . '</a>'; $sc_order_shipping.= (isset($quotes[$i]['icon']) && tep_not_null($quotes[$i]['icon']))? $quotes[$i]['icon'] : ''; $sc_order_shipping.= (tep_not_null($quotes[$i]['methods'][$j]['title'])? '<div class="shippingcontent help-block"><hr>' . $quotes[$i]['methods'][$j]['title'] . '<hr></div>': '' ); $sc_order_shipping.= '<div class="shippingamount"><span>' . $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], ((!empty($quotes[$i]['tax']))? $quotes[$i]['tax'] : null ))) . '</span></div><span class="RadioCheckmark"></span></label></td></tr>'; } } } // added to Display Message when No Shipping Options are Available $at_least_one_quote_printed = true; } } } // end if size of quotes } // end if not virtual // added to Display Message when No Shipping Options are Available if ( !$at_least_one_quote_printed ) { $sc_order_shipping .= '<tr><td class="text-center">' . MODULE_CONTENT_SC_SHIPPING_NO_OPTIONS_MESSAGE . '</td></tr>'; } $sc_order_shipping .= ' </tbody>'; $sc_order_shipping .= ' </table>'; $sc_order_shipping .= ' </div>'; $sc_order_shipping .= ' </form>'; $sc_order_shipping .= ' </div>'; // end body $sc_order_shipping .= '</div>'; //end panel tep_session_register('shipping'); ob_start(); include('includes/modules/content/' . $this->group . '/templates/tpl_' . basename(__FILE__)); $template = ob_get_clean(); $oscTemplate->addContent($template, $this->group); $script = <<<EOL <script> function shipincart_submit(sid){ if(sid){ document.estimator.sid.value=sid; } document.estimator.submit(); return false; } </script> EOL; $oscTemplate->addBlock($script, 'footer_scripts'); } // Use only when cart_contents > 0 } function isEnabled() { return $this->enabled; } function check() { return defined('MODULE_CONTENT_SC_SHIPPING_STATUS'); } function install() { tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Shipping Estimator Module', 'MODULE_CONTENT_SC_SHIPPING_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Width', 'MODULE_CONTENT_SC_SHIPPING_CONTENT_WIDTH', '12', 'What width container should the content be shown in?', '6', '2', 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', now())"); tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_SC_SHIPPING_SORT_ORDER', '400', 'Sort order of display. Lowest is displayed first.', '6', '3', now())"); tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Display item count', 'MODULE_CONTENT_SC_SHIPPING_SHOWIC', 'True', 'Display item count?', '6', '4', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Display shipping weight', 'MODULE_CONTENT_SC_SHIPPING_SHOWWT', 'True', 'Display shipping weight?', '6', '5', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping weight unit', 'MODULE_CONTENT_SC_SHIPPING_WTUNIT', 'lbs', 'Shipping weight unit.', '6', '6', now())"); tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Display Country drop-down menu', 'MODULE_CONTENT_SC_SHIPPING_SHOWCDD', 'True', 'Display Country drop-down menu?', '6', '7', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Display State drop-down menu', 'MODULE_CONTENT_SC_SHIPPING_SHOWSDD', 'False', 'Display State drop-down menu?', '6', '8', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Display Zip Code Input Field', 'MODULE_CONTENT_SC_SHIPPING_SHOWZDD', 'False', 'Display Zip Code drop-down menu?', '6', '9', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Default ZIP', 'MODULE_CONTENT_SC_SHIPPING_DEFAULT_ZIP', '', 'The dafault Zip Code to show for first time load if \"Display Zip Code\" is enabled.', '6', '10', now())"); tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Display Update button', 'MODULE_CONTENT_SC_SHIPPING_SHOWUB', 'True', 'Display Update button?', '6', '11', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); } function remove() { tep_db_query("delete from configuration where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_CONTENT_SC_SHIPPING_STATUS', 'MODULE_CONTENT_SC_SHIPPING_CONTENT_WIDTH', 'MODULE_CONTENT_SC_SHIPPING_SORT_ORDER', 'MODULE_CONTENT_SC_SHIPPING_SHOWIC', 'MODULE_CONTENT_SC_SHIPPING_SHOWWT', 'MODULE_CONTENT_SC_SHIPPING_WTUNIT', 'MODULE_CONTENT_SC_SHIPPING_SHOWCDD', 'MODULE_CONTENT_SC_SHIPPING_SHOWSDD', 'MODULE_CONTENT_SC_SHIPPING_SHOWZDD', 'MODULE_CONTENT_SC_SHIPPING_DEFAULT_ZIP', 'MODULE_CONTENT_SC_SHIPPING_SHOWUB'); } } .shippingradio table { border-collapse: separate; border-spacing: 0px 5px; } .shippingradio td{ border: solid 2px #ddd; border-radius: 10px; padding: 5px 10px 5px 10px; } .shippingradio td:hover { border: solid 2px #999; transition: border 0.5s ease-in; } .shippingradio tr.success > td{ border: solid 2px #F00; transition: border 0.5s ease-in; } .shippingamount span{ color:#333; } .shippingradio tr.success>td>label>div.shippingamount>span{ color:#F00; } .shippingcollapsible { color: #333; cursor: pointer; padding-right: 10px; border: none; outline: none; } .shippingcontent { padding: 0 18px; max-height: 0; overflow: hidden; transition: max-height 0.5s ease-out; } .shippingradio tr.success>td>label>div.shippingcontent { max-height:100%; transition: max-height 0.5s ease-out; }
  5. 1 point
    There are 2 SEO URL add-ons doing this: SEO-G (not updated since time and not compatible with latest CE BS EDGE) SEO Friendly Urls - a new approach (version for latest CE BS EDGE available, but multilanguage version is comercial) and there was another comercial solution, not listed on the marketplace, which has discontinued support for oscommerce.
  6. 1 point
    @MyBookShop Do you have this installed on a live site? If so, can you post (or pm) your site URL? M
  7. 1 point
    I may have misunderstood what you are trying to do, but you could just use a rewrite so the long url is the same as the short one. Please backup before making any changes. Below is just an example of how this can be done. Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / # from /obj/task/profile/id/1568/username # to /1568/username RewriteRule ^obj/task/profile/id(/.+)$ /$1 [R=302,L,NC] # from obj/task/page/city/41280/pageId/22/clubs//Test%20town # to 41280/22/clubs//Test%20town RewriteRule ^obj/task/page/city/([^/]+)/pageId(/.+?)/?$ /$1/$2 [R=302,L,NC,NE]
  8. 1 point
    Jack_mcs

    OSC Error Handler

    No problem. I'm glad to hear you got it going.
  9. 1 point
    Or you could lower the short word setting.
  10. 1 point
    Jack_mcs

    HoneyPot Captcha

    A new version has been uploaded with these changes: Changed the url search code to only look at the protocol and to check for named protocols. Changed the position of the error variable to make it global for the contact us page for pre-2.3 shops. Removed global option search that could fail in some cases. The first change is an important one because Russian spammers are starting to use the tld рф. There will probably be more to follow as the use of such tld's increase. The change to the code makes it so tld's are ignored so any url should be caught now. Please report any emails that get through with url's.
  11. 1 point
    Jack_mcs

    HoneyPot Captcha

    The following code will block any emails from gmail but if you truly mean to block "any spammer" from gmail, I don't think that is possible since spam can be a simple message saying "hello". But to block all emails from gmail, find if (!tep_validate_email($email_address)) { and change it to $fail = (strpos($email_address, 'gmail') !== false ? true : false); if ($fail || !tep_validate_email($email_address)) {
  12. 1 point
    raiwa

    Store Mode BS

    Uploaded update: Store Mode 1.2.1 BS Changes Version 1.2.1: - Changed .htaccess protection for backup directory and files. Thanks to @vmn - Changed redirect to 307 Thanks to @vmn - Added back time setting to 2 hours if no time is entered in ht module. Thanks to @vmn - Added show/hide back time configuration setting in ht module. - Update header content module to auto include template file and new template file naming standard.
  13. 1 point
    Dan Cole

    newsletter never be able to send out

    You can use the existing built in email functions but Steve is right it needs work and I to am surprised there are no better options that can be used within osC. It is an area that is critical, if you intend to succeed as an online marketer. I use the built in functions for smaller transactional mailings...ie anniversary coupons, new product mailings, review requests etc but I use an outside service for bulk mailings for many of the reasons Steve has mentioned. I'm always concerned about providing customer data to outside services but this is once instance where I bend a little. I do use a double opt-in subscription routine for our bulk email subscribers, to ensure that those emails are welcomed and not treated as spam. If you are located in the UK, Steve can probably help with anything you might need to do regarding the GDPR rules and what you might need to do, if anything, about providing data to external service providers. Dan
  14. 1 point
    14steve14

    newsletter never be able to send out

    Personally I wouldn't use the supplied email manager. its rubbish at best and could cause problems if those that receive the newsletter mark it as spam. It could lead to being blacklisted which is not good. I export my customers names and emails and use something like Mailchimp. There is no real good addon to link with Mailchimp which is surprising and so many people use it, but there is an addon to export customers details, which allows you to select only names and email addresses. Mailchimp is so much easier to use, tracks opening and clicks of your mail, and is free for the 2000 customers. All you then need to do is to unsubscribe customers on your site when they unsubscribe using the link in the newsletters. I used to believe that a good newsletter would do nothing for my business, but this year I have been sending weekly newsletters, and business is booming.
×