### [Solved] Price based on the weight

Hello, I wonder if there is a way to calculate the price based on the weight of each product, because I'm creating a jewelry store and need to calculate the price from the stones's weight. If so, could you give an example of how to do that?
Thanks.

Newbie

Posts

Joined
Tue Aug 02, 2016 12:01 am

### Re: Price based on the weight

analucatti wrote:Hello, I wonder if there is a way to calculate the price based on the weight of each product, because I'm creating a jewelry store and need to calculate the price from the stones's weight. If so, could you give an example of how to do that?
Thanks.
Welcome to the Opencart forum. Which OC version are you using?

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804

Regards,
Straightlight

Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

### Re: Price based on the weight

straightlight wrote:
analucatti wrote:Hello, I wonder if there is a way to calculate the price based on the weight of each product, because I'm creating a jewelry store and need to calculate the price from the stones's weight. If so, could you give an example of how to do that?
Thanks.
Welcome to the Opencart forum. Which OC version are you using?

i am using OC 2.1.0.2 version.

Newbie

Posts

Joined
Tue Aug 02, 2016 12:01 am

### Re: Price based on the weight

The weight shipping module already calculates the weight by each products. In your admin - > extensions - > shipping - > weight module, this can be found and used.

More information can be found on the docs page regarding shipping modules: http://docs.opencart.com/extension/shipping/

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804

Regards,
Straightlight

Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

### Re: Price based on the weight

Does anyone know where to edit Weight Based Shipping file that comes with OC so the weight does not show during check out just the cost?

New member

Posts

Joined
Thu Sep 06, 2012 5:03 am

### Re: Price based on the weight

Yes, depending on the OC version you're using, this would either be in your catalog/model/total/weight.php file or into your catalog/model/extension/total/weight.php file if using the latest version of Opencart.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804

Regards,
Straightlight

Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

### Re: Price based on the weight

Thanks for the information. We are using OC2.3.02. I can not find the code area to remove/edit to just remove the weight from the check out

chechout-weight.png (8.93 KiB) Viewed 2455 times

#### Attachments

code

New member

Posts

Joined
Thu Sep 06, 2012 5:03 am

### Re: Price based on the weight

Which shipping module are you using? Is it from the the core?

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804

Regards,
Straightlight

Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

### Re: Price based on the weight

Thank you for the reply. It is the core "weight base shipping"

core-ship.png (2.48 KiB) Viewed 2445 times

core-ship1.png (7.1 KiB) Viewed 2445 times

New member

Posts

Joined
Thu Sep 06, 2012 5:03 am

### Re: Price based on the weight

Since there are some parentheses that may be useful for other modules when fetching the text information, I would suggest to do the changes as the following from your catalog/model/extension/shipping/weight.php file.

Find:

Code: Select all

``````'title'        => \$result['name'] . '  (' . \$this->language->get('text_weight') . ' ' . \$this->weight->format(\$weight, \$this->config->get('config_weight_class_id')) . ')',
``````
replace with:

Code: Select all

``````'title'        => \$result['name'] . '  ()',
``````
See if that fixes the issue.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804

Regards,
Straightlight

Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

### Re: Price based on the weight

Thank you, that worked perfect..

core-ship-fix.png (4.6 KiB) Viewed 2439 times

New member

Posts

Joined
Thu Sep 06, 2012 5:03 am

### Re: Price based on the weight

No problem, enjoy.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804

Regards,
Straightlight

Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 2 guests