Code Monkey home page Code Monkey logo

Comments (11)

toasty avatar toasty commented on August 19, 2024

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.

lemonskip avatar lemonskip commented on August 19, 2024

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.

lemonskip avatar lemonskip commented on August 19, 2024

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.

toasty avatar toasty commented on August 19, 2024

(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.

lemonskip avatar lemonskip commented on August 19, 2024

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.

lemonskip avatar lemonskip commented on August 19, 2024

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.

toasty avatar toasty commented on August 19, 2024

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.

qubical1974 avatar qubical1974 commented on August 19, 2024

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.

toasty avatar toasty commented on August 19, 2024

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.

lemonskip avatar lemonskip commented on August 19, 2024

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.

qubical1974 avatar qubical1974 commented on August 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.