Jump to content

katapofatico

Members
  • Content count

    63
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by katapofatico

  1. katapofatico

    Store Mode BS

    PHP Warning: file_put_contents(../maintenance.php): failed to open stream: Forbidden access in ...includes/modules/header_tags_amantis/ht_store_mode.php on line 166 Ok, I know it's a permissions problem. But I've never known what level of permissions to grant on this situations :( What's the minimum (most conservative and secure) chmod numbers to allow writting .htaccess from ht_store_mode.php? Can you guide me please? Thanks!
  2. katapofatico

    Store Mode BS

    @@raiwa Installing the content module, on URL ...admin/modules.php?set=header_tags&module=ht_store_mode Notice: Use of undefined constant MODULE_HEADER_TAGS_STORE_MODE_MESSAGE_ - assumed 'MODULE_HEADER_TAGS_STORE_MODE_MESSAGE_' in .../includes/modules/header_tags/ht_store_mode.php on line 201 $KeysArray[] = MODULE_HEADER_TAGS_STORE_MODE_MESSAGE_ . $key; Fixed: $KeysArray[] = 'MODULE_HEADER_TAGS_STORE_MODE_MESSAGE_' . $key;
  3. katapofatico

    Spam addon

    There's a fake addon: http://addons.oscommerce.com/info/9501 Is there any control about it?
  4. katapofatico

    Spam addon

    Excuse me, it looks a simple developer confusion. The addon is correct, only the last file is a mistake.
  5. katapofatico

    [Addon} Theme Switcher

    The addon description says: Instructions are included for using the ThemeRoller tool to download stock themes and design new ones. It includes a method that allows you to design WYSIWYG on your own store pages @@kymation Please, where can we see these features?
  6. katapofatico

    [Addon} Theme Switcher

    There's a new file on addons site, uploaded by @@beauty_Bar, versioned as theme_switcher_1.5.3_1 but it hasn't any differences to previous version theme_switcher_1.5.3 by @@kymation. Maybe an error?
  7. @@Tsimi I have uploaded my header tag module here: http://addons.oscommerce.com/info/9470
  8. @@Tsimi More improvements, this time in order to avoid code changes: A ) Instead of write on admin/template_top.php, you can add these lines on admin/discount_codes.php, before applies_to_onclick() definition: $(document).ready(function() { if (<?php echo ((basename($PHP_SELF) == 'discount_codes.php' && isset($action) && $action == 'new') ? 'true' : 'false')?>) { onload(); } }); B ) Instead of modify checkout_payment.php, you can use a header_tag module that inject HTML and javascript. I have the module files but... I can't attach to this post! Anybody can show me how? C) Instead of modify 11 lines on checkout_process.php and 7 on application_top, you can use hook callings and write only 1 or 2 lines.
  9. Another improvement: Saving a new discount code from admin, can throw messages on error.log as these ones: PHP Notice: Undefined index: exclude_specials in /opt/lampp/htdocs/fenix/amantis/amantis-fenix.4/admin/discount_codes.php on line 36 PHP Notice: Undefined index: excluded_products_id in /opt/lampp/htdocs/fenix/amantis/amantis-fenix.4/admin/discount_codes.php on line 69 These fields can be disabled on the form, therefore there are not present on $_POST. This fix it: after: case 'insert': if (!empty($HTTP_POST_VARS['discount_codes']) && !empty($HTTP_POST_VARS['discount_values'])) { add: $exclude_specials = isset($HTTP_POST_VARS['exclude_specials']) ? (int) $HTTP_POST_VARS['exclude_specials'] : 0; and use $exclude_specials to create $sql_data_array: 'exclude_specials' => $exclude_specials, Other hand, replace this: if (is_array($HTTP_POST_VARS['excluded_products_id']) && sizeof($HTTP_POST_VARS['excluded_products_id']) > 0) { whith this: if (isset($HTTP_POST_VARS['excluded_products_id']) && is_array($HTTP_POST_VARS['excluded_products_id']) && sizeof($HTTP_POST_VARS['excluded_products_id']) > 0) { Notes: a ) Surely the last fix should be applied to other $_POST inspections: $HTTP_POST_VARS['categories_id'], $HTTP_POST_VARS['manufacturers_id'], etc. b ) Maybe you want to implement the getting of $HTTP_POST_VARS['exclude_specials'] not where I said (before $sql_data_array creation), but on next lines, where tou perform the other checkings and add fields to $sql_data_array, one by one.
  10. @@Tsimi On a installation without Modular Shopping Cart... When I load checkout_payment.php, error.log says: PHP Notice: Use of undefined constant MODULE_ORDER_TOTAL_DISCOUNT_TITLE - assumed 'MODULE_ORDER_TOTAL_DISCOUNT_TITLE' in .../includes/modules/order_total/ot_discount.php on line 28, referer: http://localhost/.../checkout_payment.php It can be fixed on discount_code.php, before include(DIR_WS_MODULES . 'order_total/ot_discount.php'); add: include(DIR_WS_LANGUAGES . $language . '/modules/order_total/ot_discount.php');
  11. katapofatico

    [Addon] Modular Product Page (Bootstrap)

    Yeah! That is the key Excuse me, but are you reffering to a new version not yet published, aren't you? Because version 1.1 (http://addons.oscommerce.com/info/9453) from 5/April/2016 calls to tep_get_products_special_price(). Yes, I always implement OOP and general best practices: I wonder when somebody ask for reasons, advantages, justifications, etc. about it. I think best prastices have a lot of benefits to performance, reusability, manteinability, etc.: Predictable and not predictable benefits. My criteria is: First I implement them, later I suspect about them: not the reverse: First suspect, later implement them. Best practices and design patterns are more inteligent that me, because they are historically condensed programming experiences. I like that you like it ;)
  12. katapofatico

    [Addon] Modular Product Page (Bootstrap)

    Ok, the core PHP code is avoiding duplicated product_id on specials table, but no specials table himself: in this situations I use LIMIT 1 or I define the DBB field as UNIQUE. I want to avoid full scanning of tables... I don't know specifically if this problem occurs with this query :) I don't see caching improvements on http://addons.oscommerce.com/info/9453 : public function special_price() { return tep_get_products_special_price($this->product_info['products_id']); } ...therefore on cm_pi_price.php we will query 3 times on a product with special price: if ($product_info->has_special_price() === true) { // THIS CALL TO products_price() // HERE 2 CALLS MORE: $products_price = '<del>' . $currencies->display_price( $product_info->products_price(), tep_get_tax_rate( $product_info->products_tax_class_id() )) . '</del> <span class="productSpecialPrice" itemprop="price" content="' . preg_replace('/[^0-9.]*/', '', $currencies->display_price($new_price, tep_get_tax_rate($product_info->products_tax_class_id() ))) . '">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info->products_tax_class_id() )) . '</span>'; } else { [...]
  13. katapofatico

    [Addon] Modular Product Page (Bootstrap)

    @@kymation @@burt I'm worried because if we implement this module we will break away from core improvements on product_info.php. @@burt What do you think about integrating this module on master branch?
  14. katapofatico

    [Addon] Modular Product Page (Bootstrap)

    @@kymation ok, then: a ) use your inner query b ) and cache the result (avoiding unnecessary queries) in instance attribute $new_price c ) I have added LIMIT 1 because products_id is not PRIMARY_KEY nor UNIQUE, only INDEX. What do you think about this? public function special_price() { if ($this->new_price === null) { $special_price_query_raw = " select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . $this->products_id . "' and status = 1 LIMIT 1"; $special_price_query = tep_db_query($special_price_query_raw ); $special_price_array = tep_db_fetch_array( $special_price_query ); $this->new_price = $special_price_array['specials_new_products_price']; } return $this->new_price; }
  15. katapofatico

    [Addon] Modular Product Page (Bootstrap)

    Hello, While I'm developing I active this: error_reporting(E_ALL); ...and the product_info.php of a product with special price throws: Notice: Undefined variable: new_price in [...]includes/modules/content/product_info/cm_pi_price.php on line 41 The line is: $products_price = '<del>' . $currencies->display_price( $product_info->products_price(), tep_get_tax_rate( $product_info->products_tax_class_id() )) . '</del> <span class="productSpecialPrice" itemprop="price" content="' . preg_replace('/[^0-9.]*/', '', $currencies->display_price($new_price, tep_get_tax_rate($product_info->products_tax_class_id() ))) . '">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info->products_tax_class_id() )) . '</span>'; Replacing $new_price with $product_info->special_price() solves it. For performance, I suggest this change on product_info class, using the unused class public variable $new_price: public function special_price() { if ($this->new_price === null) { $this->new_price = tep_get_products_special_price($this->product_info['products_id']); } return $this->new_price; } Thanks a lot for your usefull module!
  16. katapofatico

    [Addon] Modular Navigation Bar (Bootstrap)

    On includes/modules/content/navbar/templates/cm_nb_cart.php line 23 there is a typing error: <li><a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . HEADER_CART_VIEW_CART . '</a></li> solution: <li><a href="'<?php echo tep_href_link(FILENAME_SHOPPING_CART) . '">' . HEADER_CART_VIEW_CART ?></a></li>
  17. I've founded that it's better to declare $result before the if: in other case, if the if results false, the final sentence return $result; throws again a PHP Notice: Undefined variable. Then: function _buildHoz($parent_id, $level = 0) { $result = ''; // this line added if (isset($this->_data[$parent_id])) {
  18. 1. Fresh module install 2. Admin > install 3. Load catelog/index.php 4. Notice: Undefined variable: result in [...]includes/classes/catmenu.php on line 48 Solution: function _buildHoz($parent_id, $level = 0) { if (isset($this->_data[$parent_id])) { $result = ''; // this line added [...]
  19. Hello, I have posted a query about non intrusive tunning of categories query on category_tree.php class. Reading this post I see coincidences with my post: Anybody want to collaborate? http://forums.oscommerce.com/topic/408530-tunning-categories-query/
  20. katapofatico

    How to create payment module

    Payment module development how-to: http://forums.oscommerce.com/topic/187772-payment-module-development-how-to/
  21. katapofatico

    How to create payment module

    I'm also looking for guidelines coding a new payment method: do you know where can I find it?
×