I am trying to make it so that the url.com/my-account or the shortcode [woocommerce_my_account] displays the orders instead of the dashboard that displays “Hello User (not user)?”. The only thing I have is for after logging in which redirects to the orders instead of the dashboard, but I then going to the /my-account still displays the dashboard which I don’t
Tag: templates
Get the user email in Woocommerce “New account” email notification template
In Woocommerce I am trying to customize the “New account” email notification template changing the texts. Currently the default template shows the username but intead I want it to show the user email….
Change order of cart columns without overriding template files in Woocommerce
Is there a solution to change the order of the cart columns without copying the file in my own template folder? The reason is, that I don’t want to overwrite such a crucial template file. Unfortunately, the order is hardcoded as table in the file cart.php and not inside a function. Is there in this case any “clean” way to
WooCommerce action hooks and overriding templates
I have started to learn how to create templates with WooCommerce and I had faced with a little problem. For instance, in the php file content-single-product.php of Woocommerce plugin I have strings …
How to escape Twig like variables on JS
I need to escape some JS twig-like variables in a twig template, but I couldn’t find anything about how to do that. This variables are used in a js templating plugin that uses the same pattern as twig for variables which is causing the twig rendering to fail Unexpected token “punctuation” of value “:” (“end of print statement” expected) in
How to create a link to another PHP page
I just converted some of my HTML pages to PHP pages, and I’m not that familiar with PHP. In my HTML pages, assuming it’s just a static web app, I can link to another page quite simply by playing the following anchor on the page: <a href=”go-to-this-page.html”>This is a link</a> So, after converting the pages to PHP in order to
Undefined variables in PHP template
I use PHP as a template language in my view layer, Is it possible to make the following a little cleaner and more concise? Unfortunately, we can not even define a function for that: Answer Using @ operator is the shortest alternative. Since PHP 7 you can also use the ?? operator. Which does exactly what the @ operator does,
Smarty: unset an array index in template
I would like to do {unset($array[‘index’])} into a Smarty 3 template. Is such a syntax (or similar) supported ? After Googling and doc reading I can’t find something satisfying. Maybe I should ask for a feature request to Smarty dev team ? 🙂 Anyway, how would you do this given the currently available template functions ? Answer I don’t think
Switch statement in PHP injected HTML
It’s 1! I want to do something like that, in other words use the switch statement in PHP templates. This …
vsprintf or sprintf with named arguments, or simple template parsing in PHP
I’m searching for a way to use named arguments for sprintf or printf. Example: or via vsprintf and an associative array. I have found some coding examples here http://php.net/manual/de/function.sprintf.php and here http://php.net/manual/de/function.vsprintf.php where people wrote their own solutions. But my question is, is there maybe an standard PHP solution out there to achieve this or is there another way, maybe