westham00
Forum Replies Created
-
Hello @iarinadasdi
Here you can see, we are unable to affect the Thai CSS.
TH
https://palegreen-newt-618046.hostingersite.com/th/offer/weekday-stays-timeless-charm-2/
En- works as expected.
https://palegreen-newt-618046.hostingersite.com/offer/weekday-stays-timeless-charm-2/
This is the final part which we need help fixing, as every other class I have been able to set earlier.
Thanks in advancehello @iarinadasdi
Thank you for your support. We have been able to build the site with separate font support for the additional language from your advice. It works well.
The only issue we have is on our custom post type, we use ACF and in the WYSIWYG field, we choose to add bullet points. When trying to as css to the <ul> and <li> in the
body.translatepress-thclass, it falls back to regular (Primary language) font styles, even though the <ul> and <li> are cleanly written. In our example the we fix below by modifying the class, but it’s not very user friendly. Do you have any advice for this?thanks.
Ok, please ignore last comment. I was able to create with just CSS according to your instruction.
I can create for both H1,H2 and main body.
How can i create different rules, the body.translatepress-th covers everything.
I want to create rule for all th translatepress classes:
p
h1
h2
h3
Thank you./* Thai default text */
body.translatepress-th,
body.translatepress-th * {
font-family: 'THSarabunNew' !important;
font-size: 20px;
}
.brz .brz-a.brz-btn[href]
{
font-size: 20px;
}
{
font-size: 30px;
}
/* Brizy headings override — maximum force */
body.translatepress-th h1,
body.translatepress-th h2,
body.translatepress-th .brz-h1,
body.translatepress-th .brz-h2,
body.translatepress-th h1 *,
body.translatepress-th h2 * {
font-family: 'BRSUBansomdej' !important;
}Hi @iarinadasdi
I was able to get this to partially work using the following snippet in functions.php of child theme. The problem that I had here, was that it displayed everything in BRSU Bansomdej.
I wanted to display H1,H2 as BRSU Bansomdej, and P as THSarabunNew. I have confirmed both fonts are accessible, I just can’t create a css rule to use either.
Would you be able to help me fix? I think this snippet is of use to other TranslatePress users.
https://palegreen-newt-618046.hostingersite.com/th/
document.addEventListener("DOMContentLoaded", function () {
// Detect Thai pages
const isThai =
window.location.pathname === "/th" ||
window.location.pathname.startsWith("/th/") ||
window.location.search.includes("lang=th") ||
(document.documentElement.lang &&
document.documentElement.lang.toLowerCase().startsWith("th"));
// Remove any previously added font override
const existingStyle = document.getElementById("font-switch-style");
if (existingStyle) existingStyle.remove();
if (isThai) {
// Create a new <style> tag
const style = document.createElement("style");
style.id = "font-switch-style";
// Register fonts manually and apply styles
style.textContent =<br> /* Register THSarabunNew for body text */<br> @font-face {<br> font-family: 'THSarabunNew';<br> src: url('/wp-content/uploads/fonts/THSarabunNewBold.ttf') format('truetype');<br> font-weight: normal;<br> font-style: normal;<br> font-display: swap;<br> }<br><br> /* Register BRSU Bansomdej for H1/H2 */<br> @font-face {<br> font-family: 'BRSU Bansomdej';<br> src: url('/wp-content/uploads/fonts/BSRUBANSOMDEJRegular.ttf') format('truetype');<br> font-weight: normal;<br> font-style: normal;<br> font-display: swap;<br> }<br><br> body, body *, body.translatepress-th { <br>font-family: 'BRSU Bansomdej', serif !important; <br>}<br><br>p { <br>font-family: 'THSarabunNew', serif !important; <br>}<br><br><br><br> /* Minimal top-gap fix for Brizy first row/column */<br> .brz-row:first-of-type {<br> margin-top: 0 !important;<br> }<br> .brz-row:first-of-type > .brz-column:first-of-type {<br> padding-top: 0 !important;<br> }<br>;
document.head.appendChild(style);
}
});- This reply was modified 3 months, 3 weeks ago by westham00.
Hello,
Using Brizy Pro, and this solution does not work. do you have any other advice?
thanksThank you for the quick response? Did you just add this in the recent update last night? Impressive if so!
And now i’m finally trying to get the same value and add it to my order. I don’t seem to be able to retrieve it in the same way. Could you guide me where i’ve gone wrong. Thanks./**
* Add TTootal quantity to the product column in WooCommerce order details.
.
*/
function add_total_qty_to_product_column($item_name, $item, $order_id) {
// Debug....
error_log('Item Name: ' . $item_name);
// Get Product object
$product = $item->get_product();
// Debug
error_log('Product Object: ' . print_r($product, true));
// Calculate total_qty
$total_qty = $item->get_quantity() * mewz_wcas_get_product_multiplier($product);
// Debug
error_log('Total Qty: ' . $total_qty);
// Append total quantity to item name
$total_qty_display = sprintf('<br><small><strong>Total Qty:</strong> %d</small>', $total_qty);
return $item_name . $total_qty_display;
}
add_filter('woocommerce_order_item_name', 'add_total_qty_to_product_column', 10, 3);
// CSS
function custom_order_item_column_css() {
echo '<style>
.woocommerce-order-items .order-item .item-name small {
display: block;
font-size: 0.9em;
color: #555;
}
</style>';
}
add_action('admin_head', 'custom_order_item_column_css');@mewz Thank you for the prompt reply and hooks. With the provided hooks, perhaps you can point me where I am going wrong here then, as I seem unable to get the data on the Single Product.
Here is my example code in functions.php which hooks in. I receive no message.add_action( 'woocommerce_before_add_to_cart_form', 'display_stock_multiplier' ); function display_stock_multiplier() { global $product; // Debugging error_log( 'Debug: Product ID: ' . $product->get_id() ); $multiplier = $product->get_meta('mewz_wcas_multiplier'); error_log( 'Debug: Stock Multiplier: ' . print_r( $multiplier, true ) ); if ( ! empty( $multiplier ) ) { echo '<div class="stock-multiplier">'; echo '<p>Stock Multiplier: ' . $multiplier . '</p>'; echo '</div>'; } }Forum: Plugins
In reply to: [Advanced AJAX Product Filters] Icons Missing when logged outOk I found the root issue. FYI When using with W3 Total Cache plugin, the icons were invisible (but can still be selected)
Forum: Plugins
In reply to: [Advanced AJAX Product Filters] Icons Missing when logged outHello, I changed my icons to png upon your instructions, but I face the same issue.
Can you please help? Thank you.
Forum: Plugins
In reply to: [Advanced AJAX Product Filters] Icons Missing when logged outHello, yes i’m using .svg. is it not compatible with this format? works perfectly in admin end, just not front end.
Forum: Plugins
In reply to: [Advanced AJAX Product Filters] Plugin not working after migrationHello, thank you for the fast support. I used backupguard plugin to migrate. I was able to config again after the migration, so all is now working.
Thank you.
Thank you for your reply.
I believe I have located the issue. The vendor store itself is working correctly, and the banner etc I set is present. However when I visit the store, it directs me to the standard /shop page, and not the specific vendor page. See below.
Forum: Plugins
In reply to: [Contact Form 7] Issue with Date TagHi, thanks for your reply. Since I am not the site owner, I do not have permission to publically share. I have reached out to you directly via your slack handle. Thank you.
Forum: Plugins
In reply to: [Cart PDF for WooCommerce] Add Product AttributesHi David,
Thanks for your help. I will pursue how to add this meta data to the cart which will surely resolve my issue.
For anyone interested in how to add the variations data to cart and .PDF, it worked well for me using this in functions.php
add_filter( 'woocommerce_product_variation_title_include_attributes', '__return_false' ); add_filter( 'woocommerce_is_attribute_in_product_name', '__return_false' );- This reply was modified 4 years, 11 months ago by westham00.
Forum: Plugins
In reply to: [Cart PDF for WooCommerce] Add Product AttributesYes I am trying to display the data seen in the fields. However, this data does not display in the cart table directly: https://imgur.com/a/dneURvV
If I can pass the data to display in the cart itself, how will I then output onto the .PDF form?
Thank you.