Comments (11)
You should find it works fine if the configurable product uses the same tax classification as the associated product. If the associated product tax rules differ then the product page JavaScript has no support for handling that.
SCP is currently using the built-in Magento product-page javascript for tax calculations; I'd need to extend it to support per-associated-product tax, and I will, one day.
from magento-configurable-simple.
I superficially fixed this by adding this to "catalog/product/price.phtml" directly after the $_product is assigned:
if($_product->isConfigurable()){
// if configurable use selected product to display proper price including tax etc ....
$_product = $_product->getPriceModel()->getChildProductWithLowestPrice($_product, 'finalPrice');
$_product->load();
}
from magento-configurable-simple.
The problem here is I have a wine bottle which can be sold in bond or in duty. This is the different ways stock his held. This means that there are two stock levels to maintain ... Configurable solves that. However, duty stock incurs tax ... bond does not.
So I can't apply tax to the parent as that will apply tax to the bond (which has no tax).
So my guess is to apply the same concept above to the AJax request, simply swap it for another product and if need be swap the product back to the configurable parent.
What do you think?
(P.S. Your extension works pretty slick on Enterprise).
from magento-configurable-simple.
(P.S. Your extension works pretty slick on Enterprise).
Great! I've never had the chance to try it. Thanks for letting me know.
I'll have to look into why you need to do that fix in price.phtml. I thought on the php side it was handling per-associated-product tax correctly, but perhaps not.
On the product page the prices are taken from a JS var called spConfig rather than pulled in via AJAX (look in the product page html source). Any tier prices and custom options are AJAX'd in though. IIRC the problem is that there's only one 'taxconfig' passed within spConfig - and that's for the configurable product. I think I'd need to modify the spConfig generating code to include per-associated-product tax info, then modify the product.js code to pay attention to it.
from magento-configurable-simple.
Cool, well watch this space ... I have to get something working so your info has saved me 10 hours.
Thanks a lot!
from magento-configurable-simple.
Cool ... I have a working implementation of my idea ... I can't write it up into a proper extension because time is limited but here is the gist of it all: http://gist.github.com/613679
Excuse the pun ... Anything I've missed let me know (but it does actually work)
from magento-configurable-simple.
Wow, fab, muchas gracias. When I finally get time to update SCP I'll build this in. (or something very similar based from it).
I take it that's ok by you? I'll give you credit :)
from magento-configurable-simple.
Toasty did you get around to include this feature?
I have tried to update the files but it seems that the tax is still not updated looking in the source shows that both simple products have no tax rates:
"defaultTax":0,"currentTax":0
The switch itself is made the name is changed and the price displayed as well.
Perhaps you can tell me how I can force the use of the tax rate as specified in the simple product?
from magento-configurable-simple.
Hiya - I've not even looked at lemonskip's code yet, never mind integrated it into a release, so not sure what to suggest. I guess you'll just have to try a bunch of different things to get the tax values to get picked up? I'd have to do the same myself: working with Magento is mostly trial and error for me too.
from magento-configurable-simple.
Wow, totally forgot about this. I agree with toasty, you need a PHP swiss army knife to get to the root of whatever your trying to achieve and then polish it thereafter.
I'm crazily busy right now, but hopefully this weekend I will revisit it and drop a cleaner version.
from magento-configurable-simple.
Thanks for the quick (make that extremely quick) responses.
Lemonskip I'd love to see your integration, hope you get around to it, specially for learning purposes, the original Mage source is so limited in it's comments.
I'm trying to figure out where to get those simple rates from, the getJsonConfig seems to be the most likely place to look for it but I can't seem to find a way to get my head around how and where tax rates are actually loaded.
If I can manage to get some direction even with trial and error I should be able to get it up and running.
from magento-configurable-simple.
Related Issues (20)
- Displaying Retail Price (Crossed off) and Special Price - Not Working
- Magento Configurable Product Tax Sending Paypal Issue
- Simple product price is not updating in cart
- Lightboxpro zoom issue
- An error occurred during upload this extension on magento 1.8.1.0
- Quantity Attribute Swatch Price Help
- image swap not working
- Mulitple JS errors - OptionsPrice undefined - Magento 1.9.3.4 HOT 2
- Associated product description not change
- Uncaught TypeError: Cannot read property '1741' of undefined
- TypeError: element.options[element.selectedIndex] is undefined
- Selected Prices are not Updating on Product Page
- Link between simple and configurable (dad) products in Json of Magento
- Page loading in div after selecting configurable option
- CPU load
- PHP 7.2 Compatability
- Magento 2 Support HOT 2
- Blank Page Configurable Product
- Wrong price update when Add to Cart HOT 1
- min_price wrong on catalog_product_index_price HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from magento-configurable-simple.