MultivendorX Pro
-
AuthorPosts
-
-
May 31, 2023 at 4:27 PM #192665Dhruv JhaParticipant
Hi, I wanted to bring to your attention that when multiple products from different vendors are added to the cart, the layout of the cart page becomes distorted.
-
May 31, 2023 at 7:08 PM #192679NerdySupportExpert MoumitaKeymaster
Hi Dhruv, sorry for the inconvenience.
We have reported the issue. Our team is looking into this. You can track the progress of this issue from here https://github.com/multivendorx/MultiVendorX/issues/398
-
June 2, 2023 at 10:49 AM #192746ChrisParticipant
Hi there, may I know how to display the product sold by Vendor_Name on top of each product?
-
June 2, 2023 at 9:06 PM #192796NerdySupportExpert MoumitaKeymaster
In order to display vendor_name at the top of Product_name, add this code in the function.php of your theme
/**
* Add Sold by Vendor text
*/
public function mvx_single_product_summary() {
global $post;
if (get_mvx_vendor_settings(‘display_product_seller’, ‘settings_general’) && apply_filters(‘mvx_sold_by_text_after_products_shop_page’, true, $post->ID)) {
$vendor = get_mvx_product_vendors($post->ID);
if ($vendor) {
$sold_by_text = apply_filters(‘mvx_sold_by_text’, __(‘Sold By’, ‘multivendorx’), $post->ID);
echo ‘permalink . ‘”>’ . $sold_by_text . ‘ ‘ . $vendor->page_title . ‘‘;
do_action(‘after_sold_by_text_shop_page’, $vendor);
}
}
}add_action(‘woocommerce_before_single_product_summary’, array($this, ‘mvx_single_product_summary’), 25);
-
June 4, 2023 at 12:34 AM #192814ChrisParticipant
Hi, thanks for helping. However, the code results in critical error. Error log: syntax error, unexpected token “public”, expecting end of file. Also, if I do not enable Display Product Sellers in General Settings, how do I display vendor’s store name on top of the product_name at cart and checkout pages? Can you help to complete the following codes if the following codes are usable?
/**
* Add Sold by vendor’s store_name text on top of Cart & Checkout Pages
*/
add_action( ‘woocommerce_before_single_product_summary’, ‘display_vendor_store_name_in_single_product_summary’);function display_vendor_store_name_in_single_product_summary() {
// Get the current cart instance
$cart = WC()->cart;// Array to store the vendor IDs
$vendor_ids = array();// Loop through each cart item
foreach ($cart->get_cart() as $cart_item_key => $cart_item) {
// Get the product ID
$product_id = $cart_item[‘product_id’];// Get the vendor ID for the product
$vendor_id = get_mvx_product_vendors($product_id)->id;// Add the vendor ID to the array if it doesn’t already exist
if (!in_array($vendor_id, $vendor_ids)) {
$vendor_ids[] = $vendor_id;
}
}// Loop through the vendor IDs and display the vendor’s store name
if (!empty($vendor_ids)) {
foreach ($vendor_ids as $vendor_id) {
$store_name = to_be_modified
}
} -
June 5, 2023 at 7:03 PM #192897NerdySupportExpert MoumitaKeymaster
Our team is looking into this.
Kindly provide them with some time. -
June 5, 2023 at 10:34 PM #192901ChrisParticipant
Okay, thank you
-
June 6, 2023 at 7:27 PM #192940NerdySupportExpert MoumitaKeymaster
Hi Chris, thank you for your time and consideration. we tried to resolve your problems with most easy way and fully tested, as following…
==================
for product page
add this code on wp-content/themes/yourtheme/functions.php<?php
function mvx_after_add_to_cart_form() {
global $post;
if ( apply_filters(‘mvx_sold_by_text_after_products_shop_page’, true, $post->ID)) {
$vendor = get_mvx_product_vendors($post->ID);
if ($vendor) {
$sold_by_text = apply_filters(‘mvx_sold_by_text’, __(‘Sold By’, ‘multivendorx’), $post->ID);
echo ‘permalink . ‘”>’ . $sold_by_text . ‘ ‘ . $vendor->page_title . ‘‘;
do_action(‘after_sold_by_text_shop_page’, $vendor);
}
}
}
add_action(‘woocommerce_before_single_product_summary’, ‘mvx_after_add_to_cart_form’, 25);add_action(‘woocommerce_shop_loop_item_title’, ‘mvx_after_add_to_cart_form’, 6);
?>=====================================
for checkout page
copy:
wp-content/plugins/woocommerce/templates/checkout/review-order.php to wp-content/themes/yourtheme/woocommerce/templates/checkout/review-order.phpThe copied file will now override the WooCommerce default template file.
take out the following code from copied file, line no 40.
“<?php echo wc_get_formatted_cart_item_data( $cart_item ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>”
and move it to above line no 30. (before this code)”<?php echo wp_kses_post( apply_filters( ‘woocommerce_cart_item_name’, $_product->get_name(), $cart_item, $cart_item_key ) ) . ‘ ‘; ?>”
======================================
for cart page
copy:
wp-content/plugins/woocommerce/templates/cart/cart.php to wp-content/themes/yourtheme/woocommerce/templates/cart/cart.phpThe copied file will now override the WooCommerce default template file.
take out the following code from copied file, line no 88.
“// Meta data.
echo wc_get_formatted_cart_item_data( $cart_item ); // PHPCS: XSS ok.”and move it to above line no 79. (before this code)”if ( ! $product_permalink ) {
echo wp_kses_post( apply_filters( ‘woocommerce_cart_item_name’, $_product->get_name(), $cart_item, $cart_item_key ) . ‘ ‘ );”
-
-
June 12, 2023 at 12:11 PM #193200ChrisParticipant
Hi kundandualcube, thanks for helping. I followed the instructions but the product_name still could not appear. I tried to resolve it but I cant make it. Could you please help me?
1) For this line of code:
echo ‘permalink . ‘”>’ . $sold_by_text . ‘ ‘ . $vendor->page_title . ‘‘;
Since copying the codes from here will result in different syntax, I have to manually change “ ” and ‘’ to ” ” and ‘ ‘ respectively. I’ve tried to change them to echo ‘permalink . ‘”>’ . $sold_by_text . ‘ ‘ . $vendor->page_title . ”; but it shows another syntax error. So I tried to interpret it and change the syntax as shown in line 7 ( https://prnt.sc/AO_HT1bI-AMC ), can you please help me double check if I’ve interpret it wrongly or what should I change? -
June 12, 2023 at 12:26 PM #193205ChrisParticipant
2) For template overriding, just to double confirm, is it that I have to copy to wp-content/themes/yourtheme/woocommerce/templates/checkout/review-order.php or wp-content/themes/yourtheme/woocommerce/checkout/review-order.php ?
3) For the /yourtheme, should I use my parent theme or my child theme? Because last time when I tried to override some php files related to woocommerce, (for eg. wp-content/themes/yourtheme/woocommerce/myaccount/dashboard.php), the override only works if I copy the file to my parent theme. It doesn’t work if I copy it to my child theme.
4) For checkout page, I noticed that my parent theme has its checkout directory with review-order.php file (wp-content/themes/myparenttheme/woocommerce/checkout/review-order.php), so I guess I have to edit this file instead right? I compared both review-order.php file from the original woocommerce directory and my parent theme directory, edited the file and added the code you instructed to line 65, (before this code) <div class=”check-name” <?php echo apply_filters( ‘woocommerce_cart_item_name’, $_product->get_name(), $cart_item, $cart_item_key ) . ‘ ‘; ?></div> . The attached file below is the review-order.php file from my parent theme. Can you please help me double check if I’m doing it correctly? -
June 12, 2023 at 12:27 PM #193207ChrisParticipantThis reply has been marked as private.
-
June 12, 2023 at 1:01 PM #193210ChrisParticipantThis reply has been marked as private.
-
June 12, 2023 at 6:45 PM #193238NerdySupportExpert MoumitaKeymaster
Hi Chris, our replies are inline :
1. 1) For this line of code:
echo ‘permalink . ‘”>’ . $sold_by_text . ‘ ‘ . $vendor->page_title . ‘‘;
Since copying the codes from here will result in different syntax, I have to manually change “ ” and ‘’ to ” ” and ‘ ‘ respectively. I’ve tried to change them to echo ‘permalink . ‘”>’ . $sold_by_text . ‘ ‘ . $vendor->page_title . ”; but it shows another syntax error. So I tried to interpret it and change the syntax as shown in line 7 ( https://prnt.sc/AO_HT1bI-AMC ), can you please help me double check if I’ve interpret it wrongly or what should I change?>> sorry from my side, I didn’t double check my replay and our website took that line as a hyperlink you can copy the code from attached file.
2. For template overriding, just to double confirm, is it that I have to copy to wp-content/themes/yourtheme/woocommerce/templates/checkout/review-order.php or wp-content/themes/yourtheme/woocommerce/checkout/review-order.php ?
>> yes, the template can be overridden by copying it to yourtheme/woocommerce/checkout/review-order.php
3. For the /yourtheme, should I use my parent theme or my child theme? Because last time when I tried to override some php files related to woocommerce, (for eg. wp-content/themes/yourtheme/woocommerce/myaccount/dashboard.php), the override only works if I copy the file to my parent theme. It doesn’t work if I copy it to my child theme.
>> You have to apply the changes in the active theme. Therefore if the child theme is activated now, then you need to apply the changes there.
4. For checkout page, I noticed that my parent theme has its checkout directory with review-order.php file (wp-content/themes/myparenttheme/woocommerce/checkout/review-order.php), so I guess I have to edit this file instead right?
>> Sorry, for this, it will be better to ask the theme author and ask them whether that code will impact any flow?
Otherwise you can also add this code and see for yourself.
-
-
June 13, 2023 at 8:08 PM #193324ChrisParticipant
Thanks for the file. The snippets are working on product pages but I only need it for cart and checkout pages. For the overriding solutions provided, it causes my product name thrown to the bottom and nothing else displayed unless the ‘Display product seller’ option is enabled. What I wanted was something like this
https://prnt.sc/aIf4MoIYL1jh -
June 13, 2023 at 8:09 PM #193325ChrisParticipant
Or this
https://prnt.sc/xUqBmAal_XUS -
June 13, 2023 at 9:43 PM #193326NerdySupportExpert MoumitaKeymasterThis reply has been marked as private.
-
June 14, 2023 at 7:35 PM #193391NerdySupportExpert MoumitaKeymaster
@Chris, the flow you are looking for, doesn’t require any code.
If you have enabled “Sold by” (https://prnt.sc/3UjlI9lTMPSW), then at the checkout page you will already have the seller divided as https://prnt.sc/VHQQBdYXUX_fCan you please check again.
-
June 15, 2023 at 5:57 AM #193415ChrisParticipant
Hmm this is weird, never knew it was there at all since my first touch on it. As you can see, https://prnt.sc/deXBC5ltLy5L , “Sold by” is enabled.
-
June 15, 2023 at 5:59 AM #193416ChrisParticipant
However, its still the same when using storefront theme and all other plugins deactivated in my staging site except MVX, MVX Pro and WooCommerce
https://prnt.sc/MaP663gwoz-Q -
June 15, 2023 at 6:00 AM #193417ChrisParticipant
Even live site using storefront theme with quite a few product test also have this issue
https://prnt.sc/ulbqrWRd_mN0 -
June 15, 2023 at 6:01 AM #193418ChrisParticipant
Btw where does the customer support show? The customer support I meant was from here https://prnt.sc/deXBC5ltLy5L
Can you send me some front end/back end screenshots from your end as well? Because I cant found it on my end also… -
June 15, 2023 at 2:17 PM #193451NerdySupportExpert MoumitaKeymaster
@Chris We have checked on our end again, if the Display product seller option is enabled then on the cart the products from different sellers will be separated https://prnt.sc/Def6KY_cKoSe
Can you please share temporary admin access to your staging site so we can check on your site? -
June 15, 2023 at 3:06 PM #193460ChrisParticipantThis reply has been marked as private.
-
June 16, 2023 at 11:17 AM #193490NerdySupportExpert MoumitaKeymasterThis reply has been marked as private.
-
June 16, 2023 at 11:41 PM #193515ChrisParticipant
Hi, I cannot see the private content as this thread was not opened by me. I’ve created a new thread, can you please copy your replies at https://multivendorx.com/support-forum/topic/divided-seller-name-on-top-of-each-product-in-cart-checkout-page/
-
June 17, 2023 at 9:11 PM #193532Sangita Support SquadKeymaster
We have replied here https://multivendorx.com/support-forum/topic/divided-seller-name-on-top-of-each-product-in-cart-checkout-page/#post-193514 . Kindly check .
-
August 26, 2023 at 3:25 PM #195558Sangita Support SquadKeymaster
Its been a while and we have not heard back from you. We presume you issue is solved now. We are closing this thread. If you need help or face issue in future please open a new thread.
-
September 1, 2023 at 8:17 AM #193414ChrisParticipant
Hmm this is weird, never knew it was there at all since my first touch on it. As you can see, https://prnt.sc/deXBC5ltLy5L , “Sold by” is enabled and its still the same when using storefront theme
https://prnt.sc/ulbqrWRd_mN0
-
-
AuthorPosts
The topic ‘Issue wit the cart page after the recent update.’ is closed to new replies.