marseem
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Read more tag not workingThan you Archana,
Yes I fixed this by installing read more wp plugin which I don’t want. I thought by adding a tag of read more in classic editor will fix this issue automatically without installing any plugin but it seems that not working. Is there any method to fix this without installing a plugin?
Forum: Developing with WordPress
In reply to: Change hover text on cart, view detailsUnfortunately, I couldn’t resolve this issue. I hope somebody could help me with this.
Forum: Developing with WordPress
In reply to: Change hover text on cart, view detailsThank you, I’m trying to do this, so far no luck. Thanks for your help
Forum: Developing with WordPress
In reply to: Adding custom filed for linked productI tried as you suggested, however the snippet doesn’t work.
echo '<a . __('Link to Relevant Doll', 'txtdomain').'</a>';
add_action('woocommerce_product_options_inventory_product_data', function() {
woocommerce_wp_text_input([
'id' => '_Relevant_Doll',
'label' => __('Relevant Doll', 'txtdomain'),
'wrapper_class' => 'show_if_simple'
]);
});
add_action('woocommerce_process_product_meta', function($post_id) {
$product = wc_get_product($post_id);
$num_package = isset($_POST['_Relevant_Doll']) ? $_POST['_Relevant_Doll'] : '';
$product->update_meta_data('_Relevant_Doll', sanitize_text_field($num_package));
$product->save();
});
add_action('woocommerce_product_meta_start', function() {
global $post;
$product = wc_get_product($post->ID);
$num_package = $product->get_meta('_Relevant_Doll');
if (!empty($num_package)) {
printf('<div class="custom-sku">%s: %s</div>', __('Relevant Doll', 'txtdomain'), $num_package);?
}
echo '<a . __('Link to Relevant Doll', 'txtdomain').'</a>';
});Forum: Developing with WordPress
In reply to: Adding custom filed for linked productI replaced the code to be as the following:
add_action('woocommerce_product_options_inventory_product_data', function() {
woocommerce_wp_text_input([
'id' => '_Relevant_Doll',
'label' => __('Relevant Doll', 'txtdomain'),
'wrapper_class' => 'show_if_simple'
]);
});
add_action('woocommerce_process_product_meta', function($post_id) {
$product = wc_get_product($post_id);
$num_package = isset($_POST['_Relevant_Doll']) ? $_POST['_Relevant_Doll'] : '';
$product->update_meta_data('_Relevant_Doll', sanitize_text_field($num_package));
$product->save();
});
add_action('woocommerce_product_meta_start', function() {
global $post;
$product = wc_get_product($post->ID);
$num_package = $product->get_meta('_Relevant_Doll');
if (!empty($num_package)) {
printf('<div class="custom-sku">%s: %s</div>', __('Relevant Doll', 'txtdomain'), $num_package);?
}
'label' => '<a . __('Relevant Doll', 'txtdomain').'</a>',
});It seems the link works only backend not in frontend.
https://ibb.co/10Fb7QM
https://ibb.co/BGtJrtRWhat do you suggest?
- This reply was modified 8 months ago by marseem.
Forum: Developing with WordPress
In reply to: Adding custom filed for linked productPlease see the screenshot:
Forum: Developing with WordPress
In reply to: Adding custom filed for linked productMy main goal is to show the related product title in inventory area (meta box) above SKU to be clickable and redirect to the related product page. What is the best solution for this do you think?
Thank you again
Forum: Developing with WordPress
In reply to: Adding custom filed for linked productHello bcworkz,
I have found a code that could show the text in the meta box. I have changed the phrase to relevant doll and I added the title of the related doll, however how can I make this title clickable to redirect to the related doll page? I don’t know if I’m trying to resolve this issue with the wrong method.
The problem with this code is it shows the text but not like tag label that could be clickable to reach the related products. It is just text above the SKU. How to force this product title text to be clickable as a tag?
Thank you
add_action('woocommerce_product_options_inventory_product_data', function() {
woocommerce_wp_text_input([
'id' => '_Relevant_Doll',
'label' => __('Relevant Doll', 'txtdomain'),
'wrapper_class' => 'show_if_simple'
]);
});
add_action('woocommerce_process_product_meta', function($post_id) {
$product = wc_get_product($post_id);
$num_package = isset($_POST['_Relevant_Doll']) ? $_POST['_Relevant_Doll'] : '';
$product->update_meta_data('_Relevant_Doll', sanitize_text_field($num_package));
$product->save();
});
add_action('woocommerce_product_meta_start', function() {
global $post;
$product = wc_get_product($post->ID);
$num_package = $product->get_meta('_Relevant_Doll');
if (!empty($num_package)) {
printf('<div class="custom-sku">%s: %s</div>', __('Relevant Doll', 'txtdomain'), $num_package);
}
});Forum: Developing with WordPress
In reply to: Adding custom filed for linked productThank you bcworkz,
I understood that there are no CSS code. It is still not clear to me. I wonder whether you understood my issue. Could you recommend to me exactly what I should do to insert a new field line under the tag that includes the target product title to be clickable to redirect the user to the relevant product?
For instance, Lucas and Clara, each of them mentions the other. So the user needs to click on Clara’s title on Lucas’ page to go to Clara’s page and vice versa. So how do you suggest creating this feature? because the tag should be one word linked to both which is not what I need exactly.
I have a child theme. I can add a function filter in the theme file if you can provide me with one.I don’t know if you got my point.
Waiting for your recommendationForum: Developing with WordPress
In reply to: Adding custom filed for linked productThank you bcworkz for the suggestion. I just need to know where I add this code? In theme function or this CSS code?
Forum: Developing with WordPress
In reply to: Adding custom filed for linked productI need php code could fix this issue
Forum: Developing with WordPress
In reply to: Website pages are stuck on loadingThank you for your support.
I have removed the image and uploaded a new one and now it seems work very good.
Thank you again for your support
Forum: Developing with WordPress
In reply to: Website pages are stuck on loadingI forgot to say that I have already cleared caches even with no luck.
Forum: Developing with WordPress
In reply to: Replace awesome font with an image CSSThanks for the support. Now it worked.
Forum: Developing with WordPress
In reply to: Replace awesome font with an image CSSThe following code didn’t display the image:
.header .my-account-link .fa:before.header .my-account-link .fa:before {background-image: url(https://www.marseem.com/wp-content/uploads/2024/06/silhouette_37947.png); content: “”;}}