Jump to content

ecartz

♥Ambassador
  • Content count

    2,675
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by ecartz

  1. $add_to_cart = false; if (is_email_for_quote($product_info['products_price'])) { $products_price = show_email_for_quote($product_info); } elseif (($new_price = tep_get_products_special_price($product_info['products_id'])) && is_email_for_quote($product_info['specials_new_products_price'])) { $specials_price =show_email_for_quote($product_info['specials_new_products_price']); } else { $add_to_cart = tep_draw_button(MODULE_CONTENT_PI_BUY_BUTTON_TEXT, 'fas fa-shopping-cart', null, 'primary', array('params' => 'data-has-attributes="' . (($products_attributes['total'] > 0) ? '1' : '0') . '" data-in-stock="' . (int)$product_info['products_quantity'] . '" data-product-id="' . (int)$product_info['products_id'] . '"'), 'btn-success btn-block btn-lg btn-product-info btn-buy') . tep_draw_hidden_field('products_id', (int)$product_info['products_id']); } And then later, replace the add to cart code with if ($add_to_cart) { echo $add_to_cart; }
  2. ecartz

    Change index page

    Searching Google with "site:apps.oscommerce.com Featured Products" finds 2.3.x and Bootstrap versions.
  3. ecartz

    Mail Manager for OSC v2.3

    The two aren't separate that way. A more correct way to put it would be that the output from tpl_n_checkout.php is only used by the extra order email. To fix that, you can add echo $products_ordered; either before or after the //------insert customer chosen option eof ----
  4. ecartz

    Mail Manager for OSC v2.3

    From where you are, the easiest way would probably be to change line 28 of tpl_n_checkout_.php from echo "\n" . $product['qty'] to $products_ordered .= "\n" . $product['qty'] and line 35 from $products_ordered_attributes .= "\n\t" . $attributes_values['option'] . ' ' . $attributes_values['value']; to $products_ordered .= "\n\t" . $attributes_values['option'] . ' ' . $attributes_values['value']; Although overall I think that copying n_checkout.php to n_checkout_mm.php, renaming the class and constants accordingly, and moving order-confirm into the module and template files would be better. The two times where the code says $order->customer['firstname'] . ' ' . $order->customer['lastname'] would be better as just $order->customer['name'].
  5. ecartz

    Mail Manager for OSC v2.3

    That code is at https://github.com/gburton/CE-Phoenix/blob/master/includes/modules/notifications/templates/tpl_n_checkout.php#L27 But you might find it easier to go from the other direction. What are the instructions for making Mail Manager display the products that used to work? How did you install Mail Manager into checkout_process previously? What are you trying to do now?
  6. Perhaps if ( (!isset($_GET['sort'])) || (!preg_match('/^[1-8][ad]$/', $_GET['sort'])) || (substr($_GET['sort'], 0, 1) > count($column_list)) ) { $listing_sql .= " ORDER BY RAND()"; for ($i=0, $n=count($column_list); $i<$n; $i++) { if ($column_list[$i] == 'PRODUCT_LIST_ID') { $_GET['sort'] = $i+1 . 'RANDOM'; Note that it is relatively easy to overwhelm this form of random ordering. I think the limit is somewhere in the range of a hundred products (total in the store). And of course paging won't work so well. Because the second page will have a different random order from the first. You can fix the paging issue with something like if (!isset($_SESSION['RANDOM_SEED'])) { $_SESSION['RANDOM_SEED'] = mt_rand(); } $listing_sql .= " ORDER BY RAND(" . (int)$_SESSION['RANDOM_SEED'] . ")"; That will give a consistent ordering. Beyond that would need development. There isn't a quick solution by editing a few lines.
  7. ecartz

    Upgrading to the latest version

    Apparently something is using code from the Header Tag Controller App but you don't have it installed. This is presumably from some modification that you made to your store.
  8. Sorry, it needs the $mail. $mimemessage->send($customer_data->get('name', $mail), $customer_data->get('email_address', $mail), $from_name, $from_address, sprintf($subject, $customer_data->get('name', $mail)));
  9. Do you force cookie use? If not, perhaps the return URL is missing the session ID. Maybe echo '<form name="responseform" action="' . tep_href_link('checkout_process.php', '', 'SSL') . '" method="POST" > If you do, perhaps the cookie is getting lost when you leave the web site. A cookie cleaner perhaps?
  10. The line that sends the email is $mimemessage->send($customer_data->get('name', $mail), $customer_data->get('email_address', $mail), $from_name, $from_address, $subject); And changing it to $mimemessage->send($customer_data->get('name', $mail), $customer_data->get('email_address', $mail), $from_name, $from_address, sprintf($subject, $customer_data->get('name'))); If you set the subject to be <?php echo tep_draw_input_field('subject', 'Thank you %s for calling our clinic, it is presently closed due to our fellow Healthcare workers extreme fear of the coronavirus as they are at higher risk due to safety gear shortage.', 'id="Subject" required="required" aria-required="true"'); ?> But the tool is not really designed to be used that way.
  11. I would also point out that the original question was not if people should stop updating when they test an update and find it breaks an App (what most of the discussion suggests) but whether, starting now, someone should install 1.0.5.5 or some older version. It is certainly possible that there are Apps that are broken in 1.0.5.5 that are not broken in 1.0.5.0, but it is not definite that the (unknown) Apps that the asker needs are more broken in 1.0.5.5 than in 1.0.5.0. And it may be that some of things that that particular shop needs are easier to do in 1.0.5.5 than 1.0.5.0. In my opinion, it would be better to start with 1.0.5.5 first and figure out what is and is not possible with that rather than start with the assumption that 1.0.5.0 (or some other version) would be better.
  12. ecartz

    osC admin security warning question

    It depends on who owns the file. Sometimes 644 will work. Sometimes you need 444. If it's your server (not a host), you could chown the file instead of chmod to 444. But if a shared host, the simplest thing is to just change it to 444 or 400 or whatever.
  13. ecartz

    Google recaptcha v2 stopped working

    I don't know anything about the App, but apparently this is a general problem: https://github.com/google/recaptcha/issues/359 There are workarounds/solutions posted in the GitHub issue.
  14. Phoenix updates are designed to be small and easy to apply. So it is reasonable to start with 1.0.5.5 and plan on updating as you go. One of the goals of Phoenix is for people to stop halting at specific versions and instead add the security, bugfix, and feature updates as they release. I see no benefit to 1.0.4.5 or lower or 1.0.5.1 through 1.0.5.4. The argument in favor of 1.0.5.0 would be that it has better App support. But if you aren't expecting to go live until after 1.0.6.0 releases anyway, then there's little reason to stick with the older release. If you want to customize the fields in customer registration, then you should install 1.0.5.5. If you want to override the template display, you should plan on updating to 1.0.6.1 when it releases.
  15. If you go to https://www.oscommerce.com/Products you will see two versions listed. The v2.3.4.1 has the problem that you describe. The Phoenix Edition v1.0.5.0 is more recent and does not. In terms of the specific error that you are encountering, rename a function class_name to __construct. Phoenix mostly did that in https://github.com/gburton/CE-Phoenix/commit/f059ed430ad632133e43e50111ee5021d41cd10a#diff-b25c7caa707e98de8d250a9375b5c710
  16. Did you update from a previous version? In the address_format table, change the things that say $firstname $lastname to just say $name instead.
  17. ecartz

    Admin : categories.php slow loading

    MySQL also has cache settings in mysql.conf or whatever. Have you tried turning on query logging and testing the queries in phpMyAdmin? The logging tells you what queries the page is generating. Then run the queries in phpMyAdmin to see which are slow. With a large products_to_categories table, you might add a UNIQUE index on categories_id, products_id (in that order). Because the categories page queries from a category usually. So the primary key is backwards for its needs. That usually won't matter, but it might in your circumstance.
  18. My guess would be that USPS changed something. This surfaced intermittently because they only changed it on some servers at first. It is now always wrong because they've updated everything. No, that error means that it isn't looping through that foreach at all. It may be reaching that section of code twelve times. The simplest thing that you could try would be to change 126 to foreach (($Package['ExtraServices']['ExtraService'] ?? []) as $key => $val) { That will probably suppress the error. If it doesn't, try wrapping the entire loop in if (is_array($Package['ExtraServices']['ExtraService'] ?? null)) { //foreach here //} end of foreach } That should suppress the error but something may still not be working.
  19. ecartz

    HoneyPot Captcha

    Any checking that worked in 1.0.5.3 will work in 1.0.5.4. All 1.0.5.4 did was provide an easier way to block failures. So if it won't work in 1.0.5.4, it won't work in 1.0.5.1 through 1.0.5.3 either. To make something that would work with the change from 1.0.5.4 work in 1.0.5.1 through 1.0.5.3, someone could add the tep_block_form_processing function from 1.0.5.5 (the one from 1.0.5.4 had a typo for create_account). Or just duplicate the functionality of that function. I would say that the correct way to implement form verification in 1.0.5.1 or later would be to write replacement customer_data modules. But that's another conversation. My point here is that it is extremely unlikely that something that doesn't work in 1.0.5.4 will work in 1.0.5.1 through 1.0.5.3.
  20. ecartz

    Wishlist For Phoenix

    <script>$(document).ready(function() { $('button[name="wishlist"]').bind('click', function() { let input = document.createElement('input'); input.setAttribute('type', 'hidden'); input.setAttribute('name', 'wishlist'); input.setAttribute('value', 'wishlist'); let form = $(this).closest('form'); form.unbind('submit'); form.append(input); form.submit(); return false; });}); </script>
  21. ecartz

    Wishlist For Phoenix

    I mean your store where you have it installed. I have files for both Apps but I don't have them installed.
  22. ecartz

    Wishlist For Phoenix

    Is it publicly available? Could you PM me a link?
  23. ecartz

    Wishlist For Phoenix

    The problem that LeeFoster identified was a conflict with another App. If he turned off the header_tag module from the other App, he could get the Wishlist to work. That App has a header_tag module. The ideal would be to add this as its own header_tag module that adds to footer_scripts but for testing purposes, anything that adds to footer_scripts would probably work. For testing purposes (to verify that it works), you could add it to template_bottom. But that would put it on every page even though it's only needed on the product_info page.
  24. Why do you think that $product_info['specials_new_products_price'] would contain the special's price? The else clause shows how to get the special's price. Perhaps $new_price = tep_get_products_special_price($product_info['products_id']); if (is_email_for_quote($product_info['products_price']) || !new_price) { $products_price = show_email_for_quote($product_info); } else { would do what you want.
  25. ecartz

    FedEx - Web Services v9

    If it is traversable, then replacing line 313 with $cost = (reset($rateReply->RatedShipmentDetails)->ShipmentRateDetail->TotalNetCharge->Amount)/MODULE_SHIPPING_FEDEX_WEB_SERVICES_CURRENCY; might work. Setting it to List and explicitly casting to array might work. foreach ((array)$rateReply->RatedShipmentDetails as $ShipmentRateDetail) I'm not sure what line that is, but it is before 313 and I just added (array) to it. In a test store (not a live store, as it would break it), you could add var_dump($rateReply->RatedShipmentDetails); exit(); just before line 313 and see what it says. Try twice, once each for domestic and international.
×