Woocommerce shortcodes 'order_date' modify time/date - html

I have developped a website in Wordpress relying on Woocommerce and I am trying to customize the automated emails that are send from Woocommerce using the Decorator – WooCommerce Email Customizer Plugin.
In the email content, I would like to adjust the dates of Wordpress/Woocommerce shortcodes mainly order_date to add 10 days to it (e.g., if order_date is 13/02/2023 it should show instead 23/02/2023, thus + 10 days).
I thought this could be done using the HTML tag <time> but I couldn't find anything in that direction.
Would you have any idea?
Many thanks,
C.
I have tried using the PHP: DateTime::modify function but this doesn't work and the whole code is simply displayed in the email content. I believe it has to be done in HTML/CSS code.

Related

Insert single time coupon codes as bar codes in Netsuite HTML email template

I'm trying to create an HTML email template that displays a bar code of a single-use coupon code dynamically in Netsuite through marketing campaign using this
<barcode codetype="code128" showtext="true" value="${campaignEvent.couponCode}"/>
and nothing is showing up, but when I try to print out the coupon code using ${campaignEvent.couponCode} it is getting printed correctly
As already answered, BFO is only used for PDF generation and not email templates.
You can use an online barcode API such as Barcodes4.me and embed the result in an image:
<img src="http://www.barcodes4.me/barcode/c128a/${campaignEvent.couponCode}.png?IsTextDrawn=1" />
Another similar service is bwip-js-api
That's the correct syntax for creating a barcode on a PDF and I've used it quite a bit.
However you write you are creating an html email and I doubt the barcode tag will generate anything in html. Can you share the source of the created email around where you expect the barcode to be? You could generate a pdf with the barcode and attach it to the email.
Or you could generate the barcodes as svg values in a batch and update a custom field on the customer and then include the field contents your html that way.
https://www.npmjs.com/package/jsbarcode is a bar code generator that works in multiple environments so it's possible it could be made to work in a mass update script.

Conditional contact formula (in Wordpress)

I've Googled around for about an hour, without luck.
I'm trying to build an advanced contact formula i a Wordpress environment. The contact formula should do this:
At first, there should only be a single dropdown-menu available, like this:
Option1
Option2
Option3
If 'Option1' is selected, then some information should be shown, and then another dropdown-menu is shown, as such:
Option4
Option5
Option6
If 'Option2' is selected, then it should again show some information, but then show three other options, like this:
Option7
Option8
Option9
And so on. Many survey-formulars are built in this way - but I need to make it, to make a support-site for some different products.
I tried Googling for Wordpress-plugins, but without any luck (I must admit, I'm unsure of, what I should search for). I've used Wufoo-formula's before, but it doesn't appear to me, that Wufoo has that option.
How is this made the easiest and the best? Hand-coding it using HTML, javascript and CSS? Or are there a cool online-tool that I'm unaware of?
I had the same problem and made some research, which ended up in some results.
1. Buy the required functions
If you have a great number of forms to create and the money to invest, you could use something like Ninja Forms and buy the Conditional Logic plugin. With this you can create multiple forms and connect their elements with the needed criteria to show or hide them or to change their values.
https://ninjaforms.com/extensions/conditional-logic/
2. Code the form
Actually we have only one form we use. This is the reason, because I decided to save my money and did it myself.I expanded our wordpress theme by another page template and created the form that fits our needs in it. After that I added the PHP code to send the form via email on the top and the JavaScript code for the conditional logic on the bottom of my php file. In Wordpress I created a new page and applied the newly created page template.
I'm not sure if this is best practice, but for me it was an easy way to achieve my goal and save some time.
Best regards

GWT: get html with css from widget

I am developing an online payment and when a user makes a payment, the system should give a cheque including payment details at the end of payment process. I am using GWT and my cheque should be in pdf format. I am wondering whether there is a way to get html code from a widget with its style(css). I need this to make it pdf. i have tried:
gwtWidget.getElement().getString();
but it gives merely html code, without css. Is there a better way to get it with css?
Any sugessions would be appreciated. Thanks.
Try this one
gwtWidget.getElement().getInnerHTML()
that returns All of the markup and content within a given element

How do I grab figures from a url and place them in my page?

http://www.bloomberg.com/markets/ has several figures that I would like to display on my html page.
If I just have a div and say I want it to display how much percent some financial market has changed, how to I get the div to display whatever figure is published to Bloomberg? So that whenever I reload my website the most up to date figure from Bloomberg is displayed in plain text in my div?
So instead of
<div>0.05%</div>
I have
<div>(some code here to pull the correct figure from bloomberg)</div>
Bloomberg has an API that you can use to get their market data for free:
http://www.openbloomberg.com/open-api/
Now, you can adopt Bloomberg’s market data interfaces without cost or restriction.
What you are asking is called data parsing and it is pretty common request. If you want to do it using PHP, PHP Simple HTML DOM parser or phpQuery provide plenty of examples.

How to include html tags within a wordpress excerpt?

Currently in a wordpress template, if you use the code the_excerpt() it will display the first 55 words of a post and strips all html from the post.
I need to include <a href... tags in the excerpt so that links are still visible.
Existing methods include:
Hacking the wordpress core - definitely not an option.
using a plugin - don't want to use, it's dependent on the developer keeping the plugin up to date
writing code within functions.php to re-write the excerpt filter. - I'd prefer not to use this as it might have to be changed in future versions of WP
Is there a filter hook or other known method to include html easily without hacks?
All help is appreciated!
Cheers.
As I see it, you can only use method 2 and 3; both of them can be updated via WordPress' back-end with virtually no programming required which is ideal if you're going to be installing and using them on client sites.
Here's a tutorial with working code for method 3 -- http://aaronrussell.co.uk/legacy/improving-wordpress-the_excerpt/ and here's a plugin to use method 2 -- http://wordpress.org/extend/plugins/advanced-excerpt/
I use the following statement sometimes to get the first 55 words of a post content.
implode(' ', array_slice(explode(' ', get_the_content()), 0, 55));