thetankgirl
Forum Replies Created
-
Forum: Plugins
In reply to: [WOO Stickers by Webline] Sale and custom buttonDid the review ??
Forum: Plugins
In reply to: [WOO Stickers by Webline] Sale and custom buttonYes! Thank you!!
Forum: Plugins
In reply to: [WOO Stickers by Webline] Sale and custom buttonWill this cost me anything?
Forum: Plugins
In reply to: [WOO Stickers by Webline] Sale and custom buttonAh, when I edit the class-woo-stickers-by-webline.php directly and do this
$this->loader->add_action('etheme_before_single_product_image', $plugin_public, 'show_product_cust_badge', 2 );
It shows! Is there a way I can do this in my functions.php?
Forum: Plugins
In reply to: [WOO Stickers by Webline] Sale and custom buttonWell somehow I can not even see the custom badge in the source of my page. Already also tried playing it in my staging area but no luck so far. switching places just shows the sale ribbon on the left and nothing on the right.
https://www.bakgoed.nl/koopjeshoek/
Here you can see it in action ?? I am using 8theme xstore theme.This version gave me a wrong housenumber addition in my dhlparcel
It did gave me an idea and made me do this:preg_match('/^[[:punct:]\s]+(.*)/', $address['addition'], $clean_addition);
if (isset($clean_addition[1])) {
$address['addition'] = '-' .$clean_addition[1];
}I have tried to edit the sourcecode to try and find a temporary solution, maybe you can check it out and correct me if I’m wrong:
in class-dhlpwc-model-logic-shipment.php I changed the prepare_street_address function (see the end of the function):protected function prepare_street_address($address) { $skip_addition_check = false; $skip_reverse_check = false; $cutout = ''; if (!isset($address['street'])) { $address['street'] = trim(join(' ', array( isset($address['address_1']) ? trim($address['address_1']) : '', isset($address['address_2']) ? trim($address['address_2']) : '' ))); // Cutout starting special numbers from regular parsing logic $parsable_parts = explode(' ', trim($address['street']), 2); // Check if it has a number with letters if (preg_match('/[0-9]+[a-z]+/i', reset($parsable_parts)) === 1) { $cutout = reset($parsable_parts) . ' '; $skip_reverse_check = true; unset($parsable_parts[0]); // Check if it has a number with more than just letters, but also other available numbers } else if (preg_match('/[0-9]+[^0-9]+/', reset($parsable_parts)) === 1 && preg_match('/\d/', end($parsable_parts)) === 1) { $cutout = reset($parsable_parts) . ' '; $skip_reverse_check = true; unset($parsable_parts[0]); // Check if it has something before a number } else if (preg_match('/[^0-9]+[0-9]+/', reset($parsable_parts)) === 1) { $cutout = reset($parsable_parts) . ' '; $skip_reverse_check = true; unset($parsable_parts[0]); // Check if starts with number (with anything), but also has numbers in the rest of the address } else if (preg_match('/[^0-9]*[0-9]+[^0-9]*/', reset($parsable_parts)) === 1 && preg_match('/\d/', end($parsable_parts)) === 1) { $cutout = reset($parsable_parts) . ' '; $skip_reverse_check = true; unset($parsable_parts[0]); } $parsable_street = implode(' ', $parsable_parts); preg_match('/([^0-9]*)\s*(.*)/', trim($parsable_street), $street_parts); $address = array_merge($address, [ 'street' => isset($street_parts[1]) ? trim($street_parts[1]) : '', 'number' => isset($street_parts[2]) ? trim($street_parts[2]) : '', 'addition' => '', ]); // Check if $street is empty if (strlen($address['street']) === 0 && !$skip_reverse_check) { // Try a reverse parse preg_match('/([\d]+[\w.-]*)\s*(.*)/i', trim($parsable_street), $street_parts); $address['street'] = isset($street_parts[2]) ? trim($street_parts[2]) : ''; $address['number'] = isset($street_parts[1]) ? trim($street_parts[1]) : ''; $skip_addition_check = true; } // Check if $number has no numbers if (preg_match('/\d/', $address['number']) === 0) { $address['street'] = trim($parsable_street); $address['number'] = ''; // Addition check } else if (!$skip_addition_check) { // If there are no letters, but has additional spaced numbers, use last number as number, no addition preg_match('/([^a-z]+)\s+([\d]+)$/i', $address['number'], $number_parts); if (isset($number_parts[2])) { $address['street'] .= ' ' . $number_parts[1]; $address['number'] = $number_parts[2]; // Regular number / addition split } else { preg_match('/([\d]+)[ .-]*(.*)/i', $address['number'], $number_parts); $address['number'] = isset($number_parts[1]) ? trim($number_parts[1]) : ''; $address['addition'] = isset($number_parts[2]) ? trim($number_parts[2]) : ''; } } // Reassemble street if (isset($address['street'])) { $address['street'] = $cutout . $address['street']; } } // Be sure these fields are filled $address['number'] = isset($address['number']) ? $address['number'] : ''; $address['addition'] = isset($address['addition']) ? $address['addition'] : ''; // Clean any starting punctuations preg_match('/^[[:punct:]\s]+(.*)/', $address['street'], $clean_street); if (isset($clean_street[1])) { $address['street'] = $clean_street[1]; } preg_match('/^[[:punct:]\s]+(.*)/', $address['number'], $clean_number); if (isset($clean_number[1])) { $address['number'] = $clean_number[1]; } preg_match('/^[[:punct:]\s]+(.*)/', $address['addition'], $clean_addition); if (isset($clean_addition[1])) { $address['addition'] = $clean_addition[1]; } if (!empty($address['addition'])) { $address['number'] = $address['number'] . '-' . $address['addition']; $address['addition'] = ''; // Clear the addition to prevent duplicate concatenation
}
return $address; }Edit: this did not work correctly as it put the housenumber and addition in the same field.
- This reply was modified 1 year, 4 months ago by thetankgirl.
- This reply was modified 1 year, 4 months ago by thetankgirl.
I will test this out and report to you later, unfortunately I have a much more important bug, which I will report in another topic.
Yes thank you! I have tried it on my production and staging, so far both versions (newest and not so newest) version of woocommerce have this. I have the latest version of the plugin installed.
Oh Thanks! But it doesn’t work in de bulk-menu? Could that be arranged? Or could I make a snippet for it?
Hello Peter,
Thank you for your answer!
I already contacted bitninja and my hosting support, but they only want to whitelist ip addresses per address that gets blocked. And my hosting says the same thing.
And that’s a problem because VPN’s use several IP addresses, and I do not get to see when an IP address of a customer gets blocked.
It’s because of customers asking if my site is down that this issue got my attention, it blocks before it even gets to my site logs. Even I get blocked when I use my paid VPN. And I mean no warning, just a timeout/connection error.
So can it be used instead of the firewall on my hosting? Not a compliment, but a replacement. Sorry if I misunderstood your answer, English is not my first language.
Kind regards!
Forum: Plugins
In reply to: [PayPal Zettle POS for WooCommerce] Using zettle as payment methodBeste Joost,
Ik zal dit even in het Nederlands uitleggen:
– We proberen zoveel mogelijk onze website zelf te gebruiken, aangezien deze gebruik maakt van zoekmachine, filters en andere mogelijkheden om het vinden van een product (voor zowel als onze klanten als voor ons zelf).Daarom vroeg ik mij af of er op een of andere manier een totaal bedrag doorgestuurd kan worden van de website naar de izettle.
De rest krijg ik wel voor elkaar (het filteren van de betaalmethoden op basis van welke klant er in logt). Maar dat laatste dus niet.
Het is wel handig om te weten dat er op dit moment sprake is van een double reduction zeg maar.
Is er een website waar ik die ‘bug’ kan volgen?
Forum: Plugins
In reply to: [DHL Shipping Germany for WooCommerce] Show Parcelshop on Completed OrderHello Shin,
Thank you for your quick answer. I’ve put the code in the file for now, and will await the next update ??Thank you so much for replying!
Ik denk dat dit in het Nederlands makkelijker gaat.
Ik heb het probleem gevonden en verholpen:
Dit had ik eerst:
foreach( $order->get_items() as $item ){
en dit is het geworden
foreach( $order->get_items() as $item_id => $item ){
Dit is om de btw tarieven over de verzendkosten in verhouding te kunnen berekenen (moeilijk uit te leggen).
Dat werkt nu, maar nu zou ik graag willen weten hoe ik de facturen opnieuw kan laten genereren. Ook al verwijder ik ze handmatig in de attachments directory, dan alsnog pakt hij de ‘oude layout’ van de template.De nieuwe bestellingen pakken wel de nieuwe layout van de template.
Let op: in de database worden mijn berekeningen / aantekeningen niet opgeslagen, dus dat zou het niet kunnen zijn.In English:
The problem wasforeach( $order->get_items() as $item ){
It needed to become this:
foreach( $order->get_items() as $item_id => $item ){
Now I need to regenerate the invoices, to include the new layout of the template, how do I do this?