Jump to content

realloyalist

Members
  • Posts

    11
  • Joined

  • Last visited

1 Follower

Profile Information

  • Location
    USA
  • Activity
    User/Merchant

Recent Profile Visitors

430 profile views

realloyalist's Achievements

Newbie

Newbie (1/14)

  • First Post Rare
  • Collaborator Rare
  • Conversation Starter Rare
  • Week One Done Rare
  • One Month Later Rare

Recent Badges

4

Reputation

  1. Hello all, this is a very simple module that I created from a need my company needed that currently isn't available in the paid apps that deal with product flags. This module does only 1 thing and that is to add a flag to all products that are Virtual Products. You are able to customize what the flag says. My company wanted to clearly mark what products on our store were digital downloads vs physical items so I created this module. Feel free to examine the basic structure and code of the app to expand upon or learn to create your own modules. Works only on PS 1.7.6+ and tested on PS 1.7.8.7. virtualflags.zip
  2. So it was time to upgrade my store again and had to find how to re-apply the free orders fix. Similar steps as the fix for 1.7.6.5. From the github issue it seems like Prestashop might have fixed the issue for the 1.8 release though I find the github hard to interpret. Anyway, for PS 1.7.8.7 you will be modifying the core.js file again located in the themes directory of your installation. Start by searching the file for, var e=(0,r.default)("body") You should get 3 results. You'll want the 3rd result that has an e.on("change", statement after it. Right after the var e=(0,r.default)("body") and before the e.on statement past the following if statement. if((0,r.default)('input[data-module-name="free_order"]').length){this.toggleOrderButton();} You may then need to clear the store's cache and/or the cache of your browser. This then has allowed my freshly upgraded store to work with free items once again.
  3. Hello, I don't know if this is a bug or not but normally with Virtual Products that also have an associated file the Delivery/Carrier Step is skipped during the checkout process. However, if I have a product marked as a Virtual Product but do not have an associated file the Delivery/Carrier Step is shown during checkout though with no shipping charge. In my company's store I have products which are actually donations to our non-profit. This being the case they wouldn't have any associated download file. The problem with either not having the product as a Virtual Product or with having the delivery/carrier step being shown is that if the person trying to make a donation is from a country we do not ship to they cannot complete the order. If I associate a simple file to the product it works fine and skips the carrier selection but then the person receives the notices about a virtual download which is irrelevant being a donation. I have been searching through all the files I can think of and can't find the function that determines when the carrier selection step is shown. If anyone has any ideas I would appreciate it. Prestashop Version: 1.7.3.3
  4. Hey guys @redrob, @chon59. I believe I figured out how to make the free orders work on new versions. I did this test on PS version 1.7.6.5 so if it is the same as your versions hopefully it will work. Prestashop changed the core.js file all around and made it much more difficult to read and adjust. I did this test with a new installation of Prestashop running in a virtual machine so no guarantees it will work with production environments. File to change: core.js File found in: /themes Roughly line 161 The code is all on one really long line. Easiest way to find the spot is to search for: var e=(0,r.default)("body") There will be 2 results, the one you want is the second one on line 161 which is a good ways in the line. In the same line right after, var e=(0,r.default)("body"); insert the following code if((0,r.default)('input[data-module-name="free_order"]').length){this.toggleOrderButton();} After making this change you may need to clear Prestashop's cache under the Performance settings. This should allow free orders to be processed now. Hopefully this works for everyone.
  5. Hello @redrob, thank you for posting about 1.7.5.1 I'll be sure not to upgrade for now. I agree Prestashop should get this fixed for what should be a standard option. When I get a chance I'll try and take a look at the latest version. Unfortunately I'm not really much of a developer myself so whenever they change the coding around it takes me a while to make sense of it. Getting used to the big differences between 1.6 and 1.7 has been a struggle.
  6. Anyone else needing to allow free orders I finally found how to get PS 1.7 to work. I did this running PS 1.7.3.3. Basically the issue is that the Order button is controlled via Javascript and JQuery with the button being disabled by default. In the code the function that verifies and enables the Order button only runs when changes on the page are detected such as changing the payment option. For a free order none of those watched for triggers happens causing the Order button not to validate and enable. I added a simple if statement that looks for the free order payment type and if found runs the Order button code. Here is the changes that I made. I am not responsible for any issues that may arise from this change. I am simply stating what change I have made. File to change: core.js File found in: /themes Roughly around line 2267 you should find a section that starts with, _createClass(Payment, [{ key: 'init', value: function init() { (0, _jquery2['default'])(this.paymentSelector + ' input[type="checkbox"][disabled]').attr('disabled', false); In this function before the three $body.on statements I placed the following if statement. // If free order toggle order button if ((0, _jquery2['default'])('input[data-module-name="free_order"]').length) this.toggleOrderButton(); After saving and uploading the modified core.js file free orders now work like any other order.
  7. Thank you, that does seem to be the case. I tested by turning on the Terms and Conditions requirement and it allowed the free order to go through. Since we do not need or want that requirement though it doesn't do us much good. It would be nice if Prestashop added some functionality for handling free digital downloads though those of us needing that are probably in the minority.
  8. I can confirm the method listed here by GrandMa90 still works for PS 1.7. I don't know why Prestashop hasn't made this the default behavior. One addendum I must add is that if you are using a carrier that is free shipping overall you must add some code in another spot. In the Cart.php file edit the small if statement labeled under // Free fees if free carrier. Find this code: // Free fees if free carrier if ($carrier->is_free == 1) { Cache::store($cache_id, 0); return 0; } Replace with this: // Free fees if free carrier if ($carrier->is_free == 1) { Cache::store($cache_id, 0); $shipping_cost = 0; foreach ($products as $product) { $shipping_cost = $shipping_cost + ($product['additional_shipping_cost'] * $product['cart_quantity']); //added line } return $shipping_cost; }
  9. Edit: Fix for 1.7.3.3: Comment-3185932 Edit: Fix for 1.7.6.5: Comment-3236846 Edit: Fix for 1.7.8.7: Comment-3404464 The online store that I maintain recently created a Prestashop 1.7 store and have been slowly migrating our products over. One thing that I have discovered is that Prestashop no longer seems to allow free orders. Our online store has a number of free virtual products and in PS 1.6 this wasn't an issue at all. You could add them to your cart and checkout as normal though it would recognize the order as free and bypass the payment step. Now however, in PS 1.7 if I only have a free item in the cart and proceed with checkout it gets to the payment step and won't allow you to proceed. There are no payment methods listed to select which is good however the "Order with an Obligation to Pay" button remains grayed out not allowing you to continue. Underneath the button it has the statement, Please make sure you've chosen a payment method and accepted the terms and conditions. Can anyone else confirm that this is a bug? If so I'll file a bug report. You can try this yourself on our store here, 3abnstore.com
  10. If you want a free solution you can modify the code yourself. I have set the Order Reference to match the Order ID which is a sequential number. I then set my invoice numbers up to coincide with the same number so now the Order Reference, Order ID, and Invoice number all relatively match. You can have the Order Reference generated/set in the PaymentModule.php file within the Classes directory. If you modify the file directly you will need to make the change anytime Prestashop is updated and that file is replaced. In PaymentModule.php around line 381 for me you will find a block of code like so, if (!$result) { PrestaShopLogger::addLog('PaymentModule::validateOrder - Order cannot be created', 3, null, 'Cart', (int)$id_cart, true); throw new PrestaShopException('Can\'t save Order'); } Right after this code block insert the following two lines. $order->reference = str_pad($order->id, 6, '0', STR_PAD_LEFT); $order->update(); The code as is will set the Order Reference as the Order ID as a 6 digit number with 0 as a filler before the Order ID. I did not come up with this myself. I adapted the info from an old forum topic, https://www.prestashop.com/forums/topic/446780-change-to-same-number-idorder-and-reference/
  11. Hello, I have a Prestashop 1.6 store and use the PayPal USA and PayPal Pro modules for taking payments. The PayPal Pro is for direct credit card entry while I use the PayPal USA for allowing people to use their PayPal account through Express Checkout. The problem I am experiencing seems to be a common one in which the PayPal USA and occasionally the PayPal Pro modules will override and replace whatever addresses the customer entered in Prestashop with the addresses in the person's PayPal account. This causes problems in a couple different ways. The first is that the addresses that are returned have the First and Last names reversed so that the person's first name is in the Last Name field and vise versa. The second issue is that many of my customers ship to relatives or friends and don't think to change the address on the PayPal screen so the items end up shipping to the customer's address. I know this has been a common complaint and I've seen manual fixes for older or different versions of the PayPal module but I'm not sure how to change the behavior in this version. If someone knows how to stop addresses from being overridden in these two modules please reply. P.S. I only use the PayPal checkout button during the checkout process and don't have the button active on product pages. The versions I have are listed below. PayPal USA: 1.3.9 PayPal Pro: 1.3.5 (as a side note Prestashop shows that an update is available for PayPal Pro but when clicking Update it doesn't do anything). Thank you
×
×
  • Create New...