mamashi
Forum Replies Created
-
Hello,
No solution for me. If i had a link in action in the loop title, the link with the class “woocommerce-LoopProduct-link woocommerce-loop-product__link” break first and it’s duplicate too.
This is a exemple of my code.
add_action( 'woocommerce_before_shop_loop_item_title', function() { $category_ids = wc_get_product( get_the_ID() )->get_category_ids(); foreach ( $category_ids as $id ) { $category[] = get_term_by( 'term_id', $id, 'product_cat' ); break; } if (empty($category)) { return; } echo '<p><a>' . $category[0]->name . '</a></p>'; }, 15 );
If i remove the HTML link tag like : ‘<p>’ . $category[0]->name . ‘</p>’;
The output is good and is :<li class="product type-product post-1278 status-publish first instock product_cat-chambres virtual taxable purchasable product-type-phive_booking"> <a href="" class="woocommerce-LoopProduct-link woocommerce-loop-product__link"> <img class="woocommerce-placeholder wp-post-image" > <p>Chambres</p> <!-- THIS IS MY OUTPUT --> <h2 class="woocommerce-loop-product__title">Cambre d’Aze</h2> <span class="price"></span> </a> <a class="button product_type_phive_booking add_to_cart_button">Reserver maintenant</a> </li>
If i add the link like in my code snippet, i have this output with bug :
<li class="product type-product post-1278 status-publish first instock product_cat-chambres virtual taxable purchasable product-type-phive_booking"> <a href="" class="woocommerce-LoopProduct-link woocommerce-loop-product__link"> <img class="woocommerce-placeholder wp-post-image" > </a> <!-- Th link bug and wrap just the img instead all content --> <p> <!-- This is my output --> <a href="https://ecureuil.local/reserver/cambre-daze/" class="woocommerce-LoopProduct-link woocommerce-loop-product__link"> <!-- This link is add too with no reason --> </a> <a>Chambres</a> </p><!-- /This is my output --> <h2 class="woocommerce-loop-product__title">Cambre d’Aze</h2> <span class="price"></span> <a class="button product_type_phive_booking add_to_cart_button">Reserver maintenant</a> </li>
Forum: Developing with WordPress
In reply to: pre_get_posts and tax_query doesn’t workI got it, I have already abandoned this idea. I just wanted to understand why it’s doesn’t work. I am using the ‘knowledge’
query_varjust to pass the variable to my cpt archive page. Like a $_GET variable.
Thank you for your time ??Forum: Developing with WordPress
In reply to: pre_get_posts and tax_query doesn’t workIn my project i customize the permalink of my cpt for include the term into the url like that :
domain.com/{term_slug}/realisations/{cpt_name}
In the loop the main query check this parameters by default : ?post_type={{cpt_post_type}&name={cpt_name}&knowledge={term_slug}
In the single page template the url if the {term_slug} is wrong the page display still because the main query just ignore the term_slug and just check on the name and post_type value.
I found while my reserach the tax_query doesn’t work for single page.
I maybe a little lost.Forum: Plugins
In reply to: [WP Hotel Booking] Search form & add rooms to cartHi,
Do you have a solution for this issue ?
Forum: Plugins
In reply to: [WP Hotel Booking] Search form & add rooms to cartYes but is the Android version with yout link, the PC version is installed by the software avast directly.
Forum: Plugins
In reply to: [WP Hotel Booking] Search form & add rooms to cartHello,
The extension is provide by Avast antivirus, it’s not possible to get the extension without the antivirus. https://www.avast.com/en-us/index#pc
I found the problem.
In “hotel-booking.js’ file, in event function “$(‘form[class^=”hb-search-form”]’).submit(function (e) {});You get the unique id like this :
var _self = $(this); unique = _self.attr('class'); unique = unique.replace('hb-search-form-', '');
It’s valid just if you are just one class on your element.
I corrected like this :
var classes = _self[0].className.split(' '); for(var i = 0, l = classes.length; i < l; i++){ if(classes[i].includes('hb-search-form-')) { unique = classes[i]; break; } } unique = unique.replace('hb-search-form-', '');
It’s working.
Regards.
Forum: Plugins
In reply to: [WP Hotel Booking] Search form & add rooms to cartOk i’m finally found the problem because i don’t test the website with others browsers (it’s my fault). Your plugin works but i found the google extension who have a conflicts with your plugin.
I don’t have many extension but i have “Avast Passwords”, it’s extension of Antivirus software for record and securize passwords and the extension add a class on your form (for inject password) and it’s break your plugin.
With Avast extension (form search dosn’t work) : Extension add AVAST_PAM_nonloginform class and certainly break your js or i don’t know
<form name="hb-search-form" action="https://url.fr/" class="hb-search-form-5baf568fd9933 AVAST_PAM_nonloginform"> </form>
But if i disable the extension or i remove manualy the class with google tools developer the scripts work finally.
I hope my remark help you for improve your plugin.
Forum: Plugins
In reply to: [WP Hotel Booking] Search form & add rooms to cartOk, I admit i’m a little confused because it’s works on your video, i check on my phone, it’s works too but nothing is happened on Google Chrome on my computer…
Forum: Plugins
In reply to: [WP Hotel Booking] Search form & add rooms to cartHi,
Weird, Adblock have conflict with tout plugin ?Forum: Plugins
In reply to: [WP Hotel Booking] Search form & add rooms to cartHello,
The exemple wordpress site is at this URL : https://williamfaure.fr/.
i install wphotelbooking and few addon (coupon etc…).Regards.
Forum: Plugins
In reply to: [WP Hotel Booking] Search form & add rooms to cartHi,
For now the website is in prod in localhost but if you want, i create empty wordpress site with your plugin for test. What do you need ?
Forum: Plugins
In reply to: [WP Hotel Booking] Change payment scriptHi,
Nice, i read that on the forum or on your doc but i asked just to be sure.
Thanks.
Forum: Plugins
In reply to: [WP Hotel Booking] Change payment scriptHi,
No sorry, i talk about payment process plugin for example compatible with Woocommerce supplied by the banking establishment of my customer.
Or maybe un another plugin like Ogone to replace Stripe ? Is it possible ? Maybe if i create a class extending WPHB_Payment_Gateway_Base.
Thanks you.
Regards.