Kaushik Das
Kaushik Das

Reputation: 412

Is it possible to edit/customize php code in woocommerce cart and checkout page?

Specially wants to change functionality of those pages with custom coding. Example: If any one ask for Buy two and get one free for similar category product, then what would be the best procedure to carry on. With out plugin need solution.

Upvotes: 0

Views: 1057

Answers (2)

Omer Farooq
Omer Farooq

Reputation: 4084

Well if you dont have much experience with woocommerce then i would suggest to stick with its default functionality.

Although "buy 2 get one free" kind of plugins would be perfect for this job but as you dont want to use plugins there is one more way. You can create a variable product. In your product page, mark it as variable product and then add variations to it. You can set one variation as "buy one" with a price of lets say $50, and make it the default variation and then add another variations "buy 2 get 1 free" with a price of $100. You can also add different images with each variation.

Now on your product page, you will be able to see a drop down (or if you like radio buttons you can use it too) with the default saying "buy one" with price of $50, and when some one clicks on the "buy 2 get 1 free", the price will automatically change to $100.

Upvotes: 1

PapaHotelPapa
PapaHotelPapa

Reputation: 697

Yes, it is. The first step would be to get access to the relevant files. You can do that in several ways but the best way to go about it for your case will be to use an FTP client such as Filezilla. You can also access WooCommerce's files through the WordPress admin panel under Plugins->Editor. Bear in mind, however, that WooCommerce is a fairly massive and complex plugin and it will likely take considerable time and skill to locate the relevant files and code. Happy coding!

Upvotes: 0

Related Questions