Latest News: (loading..)

bonbec

Members
  • Content count

    68
  • Joined

  • Last visited

  • Days Won

    1

bonbec last won the day on April 5

bonbec had the most liked content!

About bonbec

Profile Information

  1. @@fanaya You can use PWA (Purchase Without Account) BS reloaded, I think that it does the same things like your "Checkout without registering".
  2. In fact, there is a big bug that I had not seen in my tests: when you put the same master item several times with different slave products, the master product is not displayed. As I can not correct my previous post, ignore my previous post. Use only this: It's work with a counter I put in a session in application_top.php. The lines marked with // line added are to be added. //Master Products // customer adds multiple products from the master_listing page case 'add_slave' : $qty_slaves = ''; // line added // switch off redirect to see debug arrays // END for last products in modal cart while ( list( $key, $val ) = each( $_POST ) ) { if (substr($key,0,11) == "Qty_ProdId_" && ((int)$val !== 0)) { $prodId = substr($key,11); $qty_slaves .= $prodId.' '; // line added $qty = $val; if(isset($_POST["id_$prodId"]) && is_array($_POST["id_$prodId"])) { // We have attributes $cart->add_cart($prodId, $cart->get_quantity(tep_get_uprid($prodId, $_POST["id_$prodId"]))+$qty, $_POST["id_$prodId"]); } else { if (isset($_POST["products_id"]) && isset($_POST['id'])) { // We have attributes with normal product only if ($prodId == $_POST['products_id']) { $attributes = $_POST['id']; } else { $attributes = $_POST["id_$prodId"]; } $cart->add_cart($prodId, $cart->get_quantity(tep_get_uprid($prodId, $attributes))+$qty, $attributes); } else { // No attributes and normal products $cart->add_cart($prodId, $cart->get_quantity($prodId)+$qty); } } } } $qty_slaves = trim($qty_slaves); // line added tep_session_register('qty_slaves'); // line added // switch off redirect to see debug arrays tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; //Master Products EOF Now, for the modal cart, in the includes/modules/content/footer/cm_footer_modal_cart.php : The lines marked with // line added are to be added. The good function execute() : function execute() { global $oscTemplate, $cart, $currencies, $languages_id; if (tep_session_is_registered('new_products_id_in_cart') && DISPLAY_CART == 'false') { $cart_contents_string = '<table class="table table-striped table-condensed">'; if ($cart->count_contents() > 0) { $products = $cart->get_products(); if (tep_session_is_registered('qty_slaves')) { // line added $qty_slaves = $_SESSION['qty_slaves']; // line added $qs_id = explode(" ", $qty_slaves); // line added } // line added for ($i=0, $n=sizeof($products); $i<$n; $i++) { for ($iqs=0, $nn=sizeof($qs_id); $iqs<$nn; $iqs++) { // line added if( $qs_id[$iqs] == (int)$products[$i]['id']){ // line added $cart_contents_string .= '<tr><td>'; $cart_contents_string .= $products[$i]['quantity'] . ' x <a href="' . tep_href_link('product_info.php', 'products_id=' . $products[$i]['id']) . '">'; $cart_contents_string .= $products[$i]['name'] . '</a>'; // Push all attributes information in an array if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) { while (list($option, $value) = each($products[$i]['attributes'])) { // echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value); //BOF - Zappo - Option Types v2 - (Hidden field moved below) $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from products_options popt, products_options_values poval, products_attributes pa where pa.products_id = '" . (int)$products[$i]['id'] . "' and pa.options_id = '" . (int)$option . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . (int)$value . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . (int)$languages_id . "' and poval.language_id = '" . (int)$languages_id . "'"); $attributes_values = tep_db_fetch_array($attributes); // - Zappo - Option Types v2 - If attrib is Text, assign to $attr_value temporarily (Here's that hidden field) if ($value == (int)OPTIONS_VALUE_TEXT_ID) { echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . TEXT_PREFIX . $option . ']', $products[$i]['attributes_values'][$option]); $attr_value = $products[$i]['attributes_values'][$option]; } else { echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value); $attr_value = $attributes_values['products_options_values_name']; } //EOF - Zappo - Option Types v2 - (Line above Assigns $attr_value) $products[$i][$option]['products_options_name'] = $attributes_values['products_options_name']; $products[$i][$option]['options_values_id'] = $value; $products[$i][$option]['products_options_values_name'] = $attr_value; // $attributes_values['products_options_values_name']; $products[$i][$option]['options_values_price'] = $attributes_values['options_values_price']; $products[$i][$option]['price_prefix'] = $attributes_values['price_prefix']; $cart_contents_string .= '<br /><small><i> - ' . $products[$i][$option]['products_options_name'] . ' ' . $products[$i][$option]['products_options_values_name'] . '</i></small>'; } } $cart_contents_string .= '</td>'; //image $cart_contents_string .= '<td class="hidden-xs hidden-sm"><a href="' . tep_href_link('product_info.php', 'products_id=' . $products[$i]['id']) . '">' . tep_image('images/' . $products[$i]['image'], $products[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>'; $products_tax = tep_get_tax_rate($products[$i]['tax_class_id']); $popup_price = $currencies->calculate_price($products[$i]['final_price'], $products_tax, $products[$i]['quantity']); $cart_contents_string .= '<td style="text-align: right; padding: 1px;" width="20%">' . $currencies->format($popup_price) . '</td></tr>'; } // line added } // line added } } $cart_contents_string .= '</table>'; ob_start(); include('includes/modules/content/' . $this->group . '/templates/modal_cart.php'); $template = ob_get_clean(); $oscTemplate->addContent($template, $this->group); $script = <<<EOL <script type="text/javascript"> $(window).on('load', function (){ $('#upCart').modal('show'); }); </script> EOL; $oscTemplate->addBlock($script, 'footer_scripts'); tep_session_unregister('new_products_id_in_cart'); } }
  3. @@hyperweb What makes the wealth of our community is sharing. When you have a problem and a community member takes time to help, the least is to give the final result so that it can help someone who is going to have the same problem.
  4. @@LeeFoster thanks :thumbsup:
  5. @@LeeFoster these lines are missing : // model or keywords for additional product search tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Additional Search Field (Keywords needs Header Tags SEO addon)', 'MODULE_NAVIGATION_BAR_STORE_SEARCH_MODEL_OR_KEYWORDS', 'Model', 'Do you want additional product search by Model or Keywords?', '6', '4', 'tep_cfg_select_option(array(\'Model\', \'Keywords\'), ', now())"); // image or icon for products 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 Image or Icon for Product Search Result', 'MODULE_NAVIGATION_BAR_STORE_SEARCH_IMAGE_OR_ICON', 'Image', 'Do you want to display product image or cart icon for product result?', '6', '5', 'tep_cfg_select_option(array(\'Image\', \'Icon\'), ', now())");
  6. @@LeeFoster And what is the correct line of text please ?
  7. It's work with a counter in application_top.php Just after : //Master Products // customer adds multiple products from the master_listing page case 'add_slave' : Add : // ADD for last products in modal cart $qty_slaves = 0; // END for last products in modal cart At the end, find : } } // switch off redirect to see debug arrays tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; //Master Products EOF Just before, add : // ADD for last products in modal cart $qty_slaves = $qty_slaves + 1; // END for last products in modal cart Now, for the modal cart, in the includes/modules/content/footer/cm_footer_modal_cart.php : Find : function execute() { global $oscTemplate, $cart, $currencies, $languages_id, $qty_slaves, $new_products_id_in_cart; if (tep_session_is_registered('new_products_id_in_cart') && DISPLAY_CART == 'false') { $cart_contents_string = '<table class="table table-striped table-condensed">'; if ($cart->count_contents() > 0) { $products = $cart->get_products(); Add just after : // ADD for last products in modal cart $qty_products = (int)count($products); $iqs = 0; if($qty_products > $qty_slaves){ $iqs = $qty_slaves; } if($qty_slaves == 1){ $iqs = count($products)-1; } // for ($i=0, $n=sizeof($products); $i<$n; $i++) { <== original line, modified in the next line for ($i=$iqs, $n=sizeof($products); $i<$n; $i++) { // END for last products in modal cart Find : ob_start(); include('includes/modules/content/' . $this->group . '/templates/modal_cart.php'); $template = ob_get_clean(); Just before, add : // ADD for last products in modal cart $qty_slaves = 0; // END for last products in modal cart It's good for me. As I am not a coder, the code can probably be cleaner.
  8. @frankl Thanks for your help. The 3 ID used are : 26 = the master product 5 = slave 1 8 = slave 2 In my product page, i choose ID5 (slave 1) and ID8 (slave 2) and then ID26 (buy button). In the modal cart : $new_products_id_in_cart = 8 tep_session_is_registered('new_products_id_in_cart') = 1 ID8 is the slave 2, the last slave I add. At night carrying advice, I will try to see if I can not put a counter in application_top.php, in the part // customer adds multiple products from the master_listing page And retrieve the value of this counter in the modal cart. But I would have preferred to retrieve the value I need in an existing variable.
  9. My idea is to use my tips : http://forums.oscommerce.com/topic/408056-bootstrap-modal-cart-with-upsell-product/page-3#entry1751784 But modufy the line : $i = count($products)-1; by $i = count($products)-XX; where XX is the number of references to show only the product master and the slaves.
  10. Hello, I am currently working locally on my new site with Osc 2.3.4BS edge. I installed Master Products and I modified it a bit so that it fits into my product_info.php page (see screenshot). It works perfectly: I choose the quantities of the products slaves and I click on the green button of the master product to add the whole to the basket. The modal cart appears but displays all the contents of the cart: - a product already in cart - master product - Slave 1 - slave 2 I just want it to display only the master product and the slaves products that I just put to the cart: - master product - Slave 1 - slave 2 The ShoppingCart Object via $ _SESSION contains all the products, so it's not good. The ShoppingCart Object also contains a value for new_products_id_in_cart, but it is the ID of the last slave placed in the shopping cart. If I have 2 slaves as in my example, I miss an ID I can retrieve the master product ID with $ _GET. $ _POST does not contain anything. Someone would have any idea ? I've been going round in circles since this morning without finding a solution. In advance thank you for a possible way.
  11. @burt Yes I see the rel="canonical", I install the module in my local 234BS Edge version. But my question is about the HTML attributes rel="next" and rel="prev" to indicate the relationship between individual URLs. If I understood correctly, but I can be mistaken, it is to indicate that page 2 is the logical continuation of page 1, etc .... As the example indicated on the page of the support Google. The objective is not the same as for the rel="canonical". Since my first post, I have seen that raiwa has created a module for rel="prev" rel="next". So I think this is a good complement to the rel="canonical".
  12. Hello, I have just read this page of Google support regarding the use of rel = "prev" and rel = "next" tags. Is it a good idea to add it to the pagination code? https://support.google.com/webmasters/answer/1663744?hl=en You can change the last 2 characters of the url to have the page in your language : en = english fr = french es = spanish de = deutch ...
  13. The start of your file must be <?php and not <!--?php
  14. Take a look to this page about count(distinct *) : http://stackoverflow.com/questions/5010470/why-doesnt-countdistinct-work
  15. @@vampirehunter, For your "1054 - Unknown column 'pd.products_nav_tabs_text_1' in 'field list'" : you forgot to add @@milerwan it's true, it doesn't work. There are curious functions : tep_get_products_nav_tabs_title_1 and tep_get_products_nav_tabs_title_2 : Fatal error: Call to undefined function tep_get_products_nav_tabs_title_1 ...