News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Ecological fee

Started by Dragoner, March 30, 2021, 09:43:26 AM

Previous topic - Next topic

Dragoner

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

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

pinochico

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 for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

Dragoner

Díky moc za odpověď, zkusím zaslaný plugin.
----
Thanks for reply, I try it.

Dragoner

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

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

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 for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

Dragoner

I know, but there is no another idea .. :(

Dragoner

Ok, I rewrite script ... now I use field in attachment.

This field i never use :)

David