Eivin Landa
Forum Replies Created
-
Forum: Plugins
In reply to: [Bring Fraktguiden for WooCommerce] Pr?ver utHei Paal,
Vi har ikke brukt nettpilots plugin s? og kan ikke hjelpe deg med hva den gj?r feil dessverre. Hvis du bruker v?r plugin og om du da fremdeles f?r opp feil priser s? skal vi hjelpe deg s? godt vi kan ??
Forum: Plugins
In reply to: [Bring Fraktguiden for WooCommerce] Desimaler – Valg for avrundingHei Rune,
Vi anbefaler ? sl? av desimaler globalt da dette gir mest p?litelig resultat. Jeg kl?r meg litt i hodet over hvorfor betalingsutvidelser krever desimaler da prisene i woocommerce fremdeles inneholder desimaler, det er kun visningen av priser i front-end som blir avrundet.
Alternativt er det mulig ? lage et filter p? fraktmetodene som avrunder prisene.
F.eks. (kode generert fra chatgpt):<?php
add_filter('woocommerce_package_rates', function ($rates, $package) {
foreach ($rates as $rate) {
$price = $rate->cost;
if (!wc_tax_enabled()) {
// No taxes enabled, simply round the price
$rate->cost = round($price);
continue;
}
$tax_display_mode = get_option('woocommerce_tax_display_cart');
$taxes = array_sum($rate->taxes);
if ($tax_display_mode === 'incl') {
// Prices are displayed including tax
$price_incl_tax = $price + $taxes;
$rounded_price_incl_tax = round($price_incl_tax);
$rate->cost = round($rounded_price_incl_tax / (1 + ($taxes / $price_incl_tax)), 2);
// Update taxes proportionally
$rate->taxes = array_map(function ($tax) use ($taxes, $rounded_price_incl_tax, $price_incl_tax) {
return (($tax / $taxes) * ($rounded_price_incl_tax - ($rounded_price_incl_tax / (1 + ($taxes / $price_incl_tax)))));
}, $rate->taxes);
continue;
}
// Prices are displayed excluding tax
$rate->cost = round($price);
// Recalculate taxes after rounding
$rate->taxes = WC_Tax::calc_shipping_tax($rate->cost, $rate->taxes);
}
return $rates;
}, 10, 2);Forum: Reviews
In reply to: [Bring Fraktguiden for WooCommerce] Poor performance with many productsHi Leif,
You can configure the amount of products the plugin will try to pack in the plugin settings. Using a lower number will improve the performance ??Forum: Plugins
In reply to: [Bring Fraktguiden for WooCommerce] Package weight isn’t a float: fatal errorThanks for reporting this. I’ve added a fix that will be published in the next version.
Jeg kunne ikke gjenskape feilen, men jeg la in en fiks for det som er beskrevet i feilmeldingen du viser til som forh?pentligvis l?ser problemet for deg. Fiksen blir publisert i neste versjon.
Forum: Plugins
In reply to: [Bring Fraktguiden for WooCommerce] Siste oppdatering JanaurHei,
Dette er en feil som kun gjelder php8.0 eller lavere. Bring Fraktguiden for WooCommerce krever php 8.1 eller nyere
Hei, jeg skal unders?ke og fikse dette f?r neste versjon. Takk for at du melder ifra
Forum: Plugins
In reply to: [Bring Fraktguiden for WooCommerce] Siste oppdatering JanaurTakk for at du melder ifra. Jeg skal unders?ke dette med en gang.
Hei Leif,
Vi bruker en pakkealgoritme for ? finne dimensjonene av handlekurven og bruker dette til ? hente tjenester og priser fra API’et til bring.
Du kan stille inn maks antall produkter for dette i plugininstillingene under fallback options.
New version has been published now ??
Hi again,
I did some more digging and found that we at one point added support for adding dropp order ids on the shipping item meta field
dropp_consignments
as either an array or a comma separated string.Note that it’s important that you use the correct shipping method id. Regular dropp shipments have the id
dropp_is
and shipments outside of capital area have the iddropp_is_oca
. You can find the id’s in the__construct
method of the shipping method class files located in theclasses/shipping-method
directory.I did encounter a bug when I tested that I fixed. That means that you might need to try this with the unreleased version of the plugin that you can find here: https://github.com/CoveAS/dropp-for-woocommerce/archive/refs/heads/master.zip
Here’s my example code:
<?php require __DIR__ . '/vendor/autoload.php'; use Automattic\WooCommerce\Client; $woocommerce = new Client( 'https://dropp.test', 'ck_******', 'cs_******', [ 'version' => 'wc/v3', ] ); // Order data $data = [ 'payment_method' => 'bacs', 'payment_method_title' => 'Direct Bank Transfer', 'set_paid' => true, 'shipping_lines' => [ [ 'method_id' => 'dropp_is', 'method_title' => 'Dropp', 'total' => '10.00', 'meta_data' => [ [ 'key' => 'dropp_consignments', 'value' => '5f889916-2f0a-4baf-91af-cc16ebe74369', ], ], ], ], // Add other order details as needed ]; $woocommerce->post('orders', $data);
Please consider giving the plugin a five star review if you found this helpful ??
There is currently no way to do it via the API.
I’ve asked GPT to write some code to add an endpoint to the API and it gave me some code that looks promising. I’ll test it and get back to you if it’s something we’ll implement.Hi Pujitha,
In order to display the dropp consignments in the WooCommerce admin you would need to create rows in the
{$wpdb->prefix}dropp_consignments
table. Preferably you would do that by creating anew Dropp_Consignment
object and then using thefill
method to populate the properties andsave
to insert into the database.// Required values for the fill method // file: models/class-dropp-consignment.php:115 $requires_value = [ 'barcode', 'dropp_order_id', 'shipping_item_id', 'location_id', ];
Alternatively you can insert directly into the database, but please note that this would increase the risk of future breakage as we may choose to alter the database table in the future.
Forum: Plugins
In reply to: [Bring Fraktguiden for WooCommerce] Plassering av valg for ‘Pose p? d?ren’Hei Rune,
Godt forslag. Vi m? nok legge inn litt javascript ogs? for ? f? dette til pga. WooCommerce laster inn mye av kassen via ajax ?? Skal se p? det n?r jeg f?r tid. Blir nok i l?pet av jan/feb.
Forum: Plugins
In reply to: [Bring Fraktguiden for WooCommerce] Fast fraktvektHei Kristian,
Interesant case dette. Jeg skal sjekke litt i koden og se om jeg kan finne en l?sning.