Some programming questions

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 年 前
Hi all,

I'm wondering if anyone who has already read and worked with the NopCommerce code can help me get started... I'm a professional developer and can if need be study the code but there's a lot of it! In return, I promise to share any knowledge I acquire!

Can NopCommerce handle the EU VAT system (17.5% for UK, 17.5% for EU unless VAT registered and customer supplies a valid EU VAT number, 0% for everyone else). I'm pretty sure the answer is "no" and that I'll need to write a provider. So:

*Is there any way to add fields to the account creation page (VAT number) via the database and then retrieve them in the arguments sent to my tax provider or would I have to hack the .aspx file?

*Can I programatically add items to the cart? In addition to a run-of-the-mill shopping cart I need to add functionality to an existing site whereby customers can purchase "add ons" - it's basically a membership system - paid-for addons to a free site. Manipulating the cart would likely be easier than writing against the PayPal Pro API myself.

*Is there any global handler I can tap into for when an order is processed? Or is it again a case of having to hack individual aspx pages?

Thanks in advance.
14 年 前
kingboyk wrote:

Can NopCommerce handle the EU VAT system (17.5% for UK, 17.5% for EU unless VAT registered and customer supplies a valid EU VAT number, 0% for everyone else). I'm pretty sure the answer is "no" and that I'll need to write a provider. So:

YES, you can set up different taxes for different countries and different product types. And you can also mark a customer as Tax Exempt.

kingboyk wrote:

*Is there any way to add fields to the account creation page (VAT number) via the database and then retrieve them in the arguments sent to my tax provider or would I have to hack the .aspx file?

If I'm correct then the upcoming 1.6 version will have user defined fields for customers. So you can add your own VAT number field then.
For one of our customers we have implemented it since version 1.3 by adding a new field to the database and editing the source. But remember that there is more to change then just a aspx file. You will need to change the data access layer and the customer logic.

kingboyk wrote:

*Can I programatically add items to the cart? In addition to a run-of-the-mill shopping cart I need to add functionality to an existing site whereby customers can purchase "add ons" - it's basically a membership system - paid-for addons to a free site. Manipulating the cart would likely be easier than writing against the PayPal Pro API myself.

Yes, we have implemented a 'gift' system that will allow customers to select a gift that will be automagically added to the cart, just before they confirm the order.
What you need to have is the ProductVariant and 'convert' it to a OrderProductVariant. Then you can add it to the current cart.

kingboyk wrote:

*Is there any global handler I can tap into for when an order is processed? Or is it again a case of having to hack individual aspx pages?

Look at the OrderManager. We send out messages to warehouses once the order is set to paid. But you can also use the other procedures like when an order is initially saved or set to Completed.
14 年 前
Excellent replies :)  I have one more question if you don't mind - What would be the process of adding a new field to a product?

Can you tell me which sections I need to edit after I have created the field in the DB - I see its powered by stored procedures to I know I would have to update these?
14 年 前
In order to add a new field that eventually needs to be stored in the database need more customization in the code

these are the things that you have to do in order to accomplish that:

1) Creation of new column i.e. In the database table
2) Adding new field in business logic, new business layer classes, new datalayer classes.
3) All the code for update, insert and selection of this ADDED field needs to be done according to nopcommerce architecture.

Hope it helps
14 年 前
Brilliant, some really helpful pointers there - thanks very much indeed.
14 年 前
See this link - I've added fields to product & productvariable tables and it's quite easy

https://www.nopcommerce.com/boards/topic.aspx?topicid=2654
14 年 前
Cheers.

I've searched the forums and couldn't find any answers, so does anyone know if the custom fields will be making it into 1.6 and what the timescale is for the release of that version?
14 年 前
rcnopcom wrote:
See this link - I've added fields to product & productvariable tables and it's quite easy

https://www.nopcommerce.com/boards/topic.aspx?topicid=2654


Awesome... Exactly what I was always looking for
14 年 前
It's a bit of a shame that this stuff has to be done by editing nopCommerce files though. I'd have preferred they used App_Code and declared partial classes or somehow allowed subclassing.
14 年 前
IMO I'd much prefer this to be done via Linq2SQL classes :(
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.