Author Topic: Ecological fee  (Read 559 times)

Dragoner

  • Beginner
  • *
  • Posts: 38
Ecological fee
« on: March 30, 2021, 09:43:26 am »
Hi, I'm solving the problem with displaying the environmental fee for car bulbs.

I need show in cart under product environmental (ecological fee).
I have custom field name as ecological fee ... etc.
In product a select them, but I can't enter the amount, I have to enter it as a value, because it must not be added to the price of the product. The price in the basket is final for the product, including the fee. I only need to display information about the amount of the fee for the given product. Which I did in part. But if I add 2 pieces of product to the cart, the amount of the fee will not double.

Attachments
1. poplatek.png --- product in cart, 1 piece
2. poplatek 2pieces.png --- product in cart, 2 pieces, bad fee
3. product_cumstomfield_detail.png --- product detail (custom field)

Is possilble make custom field with price show under product in cart (like image 1), but with calculate this field x product pieces?

Thank you very much

PS: I´m building now 2 eshop, where i must use it :(

Version VM:  3.8.8 10472

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10140
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Ecological fee
« Reply #1 on: March 30, 2021, 10:30:22 am »
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

pinochico

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1137
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
Re: Ecological fee
« Reply #2 on: March 30, 2021, 13:15:21 pm »
Roozhodně není možné použít klasický customfiled typu string.
Ten Vám nespočítá poplatek podle počtu ks.

Musíte použít jiný typ customfiledu, který bude měnit cenu poplatku (ne celkovou cenu produktu).

Buď ten co odkazuje GJC, ale musíte zajistit by byl viditelný jen v košíku a v emailu a na detailu produktu nebylo možné si ho uživatelsky měni
nebo zkuste najít jiný typ customfiledu na internetu.
začal bych známými firmami jako je Breakdesign, Daycount a další.

---

It is definitely not possible to use a classic customfiled type of string.
He will not calculate the fee for you according to the number of pieces.

You must use another type of customfiled that will change the price of the fee (not the total price of the product).

Either the one that links GJC, but you must ensure it would be visible only in the cart and in the email and it was not possible to change it by user on the product detail
or try to find another type of customfiled on the internet.
I would start with famous companies like Breakdesign, Daycount and others.
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds from products, orders and database table
Virtuemart Email Manager - customs email templates

Dragoner

  • Beginner
  • *
  • Posts: 38
Re: Ecological fee
« Reply #3 on: March 30, 2021, 20:10:52 pm »
Díky moc za odpověď, zkusím zaslaný plugin.
----
Thanks for reply, I try it.

Dragoner

  • Beginner
  • *
  • Posts: 38
Re: Ecological fee
« Reply #4 on: April 01, 2021, 14:01:38 pm »
HI, GJC Web Design ... i try all of the variants, but the variant price does not rise (in attachment).

Thank you for your reply.

David

Dragoner

  • Beginner
  • *
  • Posts: 38
Re: Ecological fee
« Reply #5 on: April 02, 2021, 11:56:56 am »
Hi, i solved by this code by field weight on product.

<?php function cWeight($products){
      $tweight= 0;
      foreach ( $products as $prow) {
         $tweight += $prow->product_weight*$prow->quantity;
      }
 return $tweight;
   } ?>


Then, you can echo it anywhere you want like this


   <?php echo cWeight($this->cart->products);?>

I add this code to cart.


pinochico

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1137
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
Re: Ecological fee
« Reply #6 on: April 02, 2021, 16:07:51 pm »
hmmm, i think is not right

then in future you stop function shipping by weight, because you use this field for fee
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds from products, orders and database table
Virtuemart Email Manager - customs email templates

Dragoner

  • Beginner
  • *
  • Posts: 38
Re: Ecological fee
« Reply #7 on: April 03, 2021, 10:55:42 am »
I know, but there is no another idea .. :(

Dragoner

  • Beginner
  • *
  • Posts: 38
Re: Ecological fee
« Reply #8 on: April 03, 2021, 11:10:46 am »
Ok, I rewrite script ... now I use field in attachment.

This field i never use :)

David