Post by analucatti » Tue Aug 02, 2016 12:04 am

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

Post by straightlight » Tue Aug 02, 2016 12:40 am

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?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by analucatti » Tue Aug 02, 2016 8:30 pm

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

Post by straightlight » Tue Aug 02, 2016 8:37 pm

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/

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by kombi » Mon Aug 08, 2016 2:01 pm

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

Post by straightlight » Mon Aug 08, 2016 5:14 pm

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.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by kombi » Tue Aug 09, 2016 12:53 am

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

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

Attachments


New member

Posts

Joined
Thu Sep 06, 2012 5:03 am

Post by straightlight » Tue Aug 09, 2016 3:27 am

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

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by kombi » Tue Aug 09, 2016 3:49 am

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

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

core-ship1.png

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


New member

Posts

Joined
Thu Sep 06, 2012 5:03 am

Post by straightlight » Tue Aug 09, 2016 3:57 am

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.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by kombi » Tue Aug 09, 2016 4:22 am

Thank you, that worked perfect..
core-ship-fix.png

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


New member

Posts

Joined
Thu Sep 06, 2012 5:03 am

Post by straightlight » Tue Aug 09, 2016 4:31 am

No problem, enjoy.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


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 18 guests