Jump to content

[Resolved] Make Product Tax Class Mandatory


Mike MacKechnie

Recommended Posts

I need to make the Tax Class a mandatory field when using the Add Product option in the Admin panel.

Using CC V6.0.8, the drop down for the Tax Class, in the Pricing Tab of Add Product, shows "Please Select" as the default setting.

If the administrator forgets to assign a tax class to the product, the product will still be created, but with a tax class value of 0.

I am currently developing some sales reports for my client, which is when I noticed these errant products. My client sells a lot of books, which are zero rated for tax, hence I was the first to spot this.

So what I need is a check on the product before it is created, and some sort of error message and/or warning when the tax class has not been sent.

I guess that I could live with the products being created, simply with a warning message about the tax class at the top of the screen, but the best solution would be to prevent the product from being created until the tax class had been selected.     

 

If this has already been raised as a topic then apologies but I have done a fairly comprehensive search.

If this needs a git request raised let me know.

Any advice appreciated. 

  

 

Link to comment
Share on other sites

Alternatively, you could add the `required="required"` attribute to the parent select element on the previous line:

<select name="tax_type" id="tax_type" class="textbox" required="required">

That should cause the form to highlight that input element upon submitting without selecting an option.

Link to comment
Share on other sites

If making changes to admin skin templates then we strongly advise you to make a copy of the templates, called something else, so that these changes are not overwritten when doing an upgrade.  When doing an upgrade, you will then also need to compare changes to the template files from your current CubeCart version to the new version and apply any new changes introduced.

Ian

Link to comment
Share on other sites

What Ian says is true, but a much better solution than making copies is to use a version control system such as Git - then whenever you upgrade, it is a simple process to re-apply all of your personal changes on top of the latest CC version. This becomes more and more useful the more changes you make.

Link to comment
Share on other sites

Yes of course git is a great solution but probably completely beyond most users (a guide on installing and using this for the average user would be a great community resource if you were willing !). The plugin functionality was introduced to CubeCart (and other products like WordPress for example) to allow function changes without changing any core files and this has always got to be the recommended way of doing changes

Ian

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...