-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thank you so much for making this plugin available. A couple of suggestions. #2
Comments
HI Johnzhel, Great to hear that his helped you out with displaying discounts.
I will take a look and resolve this as the output checks for an integer so only numbers can be entered and displays a 0 if blank.
It's not something that I would add at the moment with the way the discounts function as when you have more than a single advanced product discount on an individual product it becomes extremely complex to display discounts. I'm on holiday at the moment and will resolve the 0 issue next week. ;) |
@stuartduff Thank you for your reply. I had some other issues with the site, so I deleted everything including WordPress (it is a new site). Then I reinstalled WordPress and all the plugins. Now the dynamic pricing table does not show up any more for the new installation. I checked the source code of the product page, the table code was not found in between the "in stock" line and "Add to card" line. In other words, these is not "dynamic-pricing-table" showing up in the page raw html code. Current WordPress is Version 4.5.3, WooCommerce is Version 2.6.4, Woo Dynamic Pricing is Version 2.11.5. I don't remember what were on the last installation that actually had the pricing table working well (which was installed 2 weeks ago). It seems for the latest installation, the pricing table was not injected into the product page. I checked the dynamic pricing of that product, it did work well (I could see the discount applied in the cart). Now, I need to make the pricing table show up on the product page. Do you know where should I look or check? Thanks! |
I tried a couple of things just to verify if this is caused by other themes/plugins.
|
Hey @johnzhel Cross testing for you the pricing table is displaying without any issues on my test sites, it could maybe be related to a theme you are using though if it overrides default WooCommerce template files. Try testing on your site with a free theme like Storefront installed and activated and all other plugins deactivated. For the issue related to the 0 displaying this is due to validating the output as it must be a number so instead of leaving the field blank add a maximum number like 9999 or similar. Cheers |
I am also have trouble with 0 being inputed on the front end when I leave something blank. Right now I need to be able to set my last rule as a minimum only (ex. 576 - infinity) |
I forked @stuartduff's original code made a few slight improvements to it, including having that last 0 replaced with " or more": https://github.com/SturmB/woocommerce-dynamic-pricing-table It's currently waiting for my pull request to be accepted back into the master branch. (I hope I'm using this terminology correctly; I'm still a Git & Github newb.) |
Hey @SturmB, thanks for this, all contributions, thoughts and pull requests are welcomed :) I will give this a test tomorrow across all pricing scenarios and if all is okay get it merged into master. |
Hey @SturmB, I got to spend some time this evening testing your pull request and your ideas were solid as to how to resolve the issues. I didn't actually merge those though on this occasion and I wanted to explain a little about why as it was nothing you did wrong or similar with your code or pull request ( Great job on that and you only learn by doing ). :D When researching for the pricing issues with regards to proper decimalisation of the currency amount output I looked to the WooCommerce plugin which has a function titled wc_price() in favor of using PHP's number_format. With wc_price() it will format the number passed to it in the stores chosen currency format and also add the currency symbol too. This means if the store owner were to change their currency format in WooCommerce that change would also be represented within the discount tables. For the or more text I also used your idea but wrote the code a little differently by checking for a value less than 1 along with making sure the text was also localized so it can be translated / changed. For some of the text changes you suggested I rejected these for the moment. The main reason being is that all the text within the plugin is localized and can be changed by using a plugin like Loco Translate from the admin dashboard of your WordPress site. Although loco translate contains the word translate it is also used for changing English phrases or words within a theme or plugin into other English words or phrases as an example. This way you don't edit any plugin files and if I release an update to the plugin in the future you don't lose any changes to the text that you may have made, this also follows the standards of WooCommerce and WordPress with regards to hard coded text. You can grab v1.0.1 from the releases section and it now looks like this below in the table. Thanks to everyone for your code contributions and suggestions as they are always really appreciated as collaboration improves everything. https://github.com/stuartduff/woocommerce-dynamic-pricing-table/releases Let me know how this version works out for you all. Cheers |
I'm glad you are so much more familiar with WooCommerce & Wordpress in general than I am, @stuartduff! I was sure that there must be some way to have the currency localized better, but was completely unaware of I will say, however, that I think you misunderstood my use of Also, I'll definitely check out Loco Translate as soon as I have some time. It sounds like a much easier way of having text phrases in the table appear the way you want without having to program in a Settings control panel for the backend of the site. Again, thank you so much for being awesome and giving us this excellent plugin! |
@SturmB I was just happy I could offer a solution to a common request with regards to the Dynamic Pricing plugin and seeing people like yourself using the plugin and contributing ideas is awesome. I think you're also right with regards to me maybe misunderstanding what you intended using the number_format for. And it's something I'm happy to discuss further.
That would make sense now that I have read it back and correctly understood the reasoning as once you get into quantity numbers like 12,000 and above which is not actually something I thought of or tested Doh!, good call :) Looking at WooCommerce it has a formatting function titled wc_stock_amount() which we can pass the quantity values through and which should work to format those :) I will get this added and test ;) |
After testing this the format of 123567 is actually correct as the default quantity as by defult the https://github.com/woothemes/woocommerce/blob/master/includes/wc-core-functions.php#L37 I have added the Them main The changes are included in v1.0.2 below. v1.0.2: https://github.com/stuartduff/woocommerce-dynamic-pricing-table/releases/tag/1.0.2 |
@stuartduff I have been looking for this days and nights. Thank you for creating it! I have a couple of suggestions:
Such as:
Blue+Large Variation
.... Price Table here....
Blue+Small Variation
.... Price Table here....
Green+Large Variation
.... Price Table here....
etc.
Thanks again!
The text was updated successfully, but these errors were encountered: