MarieveC
Forum Replies Created
-
In the link you sent me, it says:
The layered navigation widget only appears on product archives.Can I show the filters with shorttag or something else ?
My code is all done, I just need to speed up the thing. I’d really like to understand why I can’t retrieve all the attributes with one call (get_attributes)…
See: http://meprogweb.com/temp/Clipboard01.png
When a checkbox is checked, all the other data from this category needs to hide, and the amount of products by data needs to update. I’m doing it in jQuery.
Which widget can I use to do that?
So, why can’t I get my attributes with the get_attributes() function?
Thanks for you answer Caleb. I don’t understand your question: How are the core layered nav widgets falling short for what you need?
I don’t think I can use a widget to do what I need.I’ll resume my problem…
When I execute this code:
$product = new WC_Product( $produit_id );
$tous_produits[$produit_id]['Lien_Photo'] = $product->get_attribute( 'Lien_Photo' );
$tous_produits[$produit_id]['Lien_Specsheet'] = $product->get_attribute( 'Lien_Specsheet' );
$tous_produits[$produit_id]['Photometrie'] = $product->get_attribute( 'Photometrie' );
$tous_produits[$produit_id]['ID_Famille'] = $product->get_attribute( 'ID_Famille' );
$tous_produits[$produit_id]['ID_Sous_Famille'] = $product->get_attribute( 'ID_Sous_Famille' );
$tous_produits[$produit_id]['ID_Manufacturier'] = $product->get_attribute( 'ID_Manufacturier' );
$tous_produits[$produit_id]['ID_Marque'] = $product->get_attribute( 'ID_Marque' );
$tous_produits[$produit_id]['ID_Serie'] = $product->get_attribute( 'ID_Serie' );
$tous_produits[$produit_id]['ID_Voltage'] = $product->get_attribute( 'ID_Voltage' );
$tous_produits[$produit_id]['ID_Source'] = $product->get_attribute( 'ID_Source' );
$tous_produits[$produit_id]['ID_Type_de_source'] = $product->get_attribute( 'ID_Type_de_source' );
$tous_produits[$produit_id]['ID_Installation'] = $product->get_attribute( 'ID_Installation' );
$tous_produits[$produit_id]['guide_stock'] = $product->get_attribute( 'ID_GD' );
$tous_produits[$produit_id]['Prix_Budget'] = $product->get_attribute( 'Prix_Budget' );
$tous_produits[$produit_id]['Lumen_emis'] = $product->get_attribute( 'Lumen_emis' );
$tous_produits[$produit_id]['Wattage'] = $product->get_attribute( 'Wattage' );
$tous_produits[$produit_id]['id_es'] = $product->get_attribute( 'ID_ES' );
$tous_produits[$produit_id]['id_dlc'] = $product->get_attribute( 'ID_DLC' );
$tous_produits[$produit_id]['id_dlcp'] = $product->get_attribute( 'ID_DLCP' );
It works:
Array ( [1078] => Array ( [title] => H1499T-1495P [description] => LUMINAIRE ENCASTRÉ TYPE GIMBAL MR16 DE COULEUR BLANC [Lien_Photo] => HALO_1495.jpg [Lien_Specsheet] => HALO 1495.pdf [Photometrie] => Non Disponible [ID_Famille] => Luminaires Downlight [ID_Sous_Famille] => Orientable [ID_Manufacturier] => Eaton [ID_Marque] => Halo [ID_Serie] => HALO 1495 [ID_Voltage] => 120V [ID_Source] => INC [ID_Type_de_source] => MR16 [ID_Installation] => Encastré Rond 4'' [guide_stock] => O [Prix_Budget] => $65 [Lumen_emis] => ? [Wattage] => ? [id_es] => N [id_dlc] => N [id_dlcp] => N ) )
When I try this code:
$product->get_attributes();
It doesn’t work, all values are empty:
Array ( [pa_id_gs] => Array ( [name] => pa_id_gs [value] => [position] => 0 [is_visible] => 1 [is_variation] => 1 [is_taxonomy] => 1 [is_create_taxonomy_terms] => 1 ) [pa_id_gd] => Array ( [name] => pa_id_gd [value] => [position] => 1 [is_visible] => 1 [is_variation] => 1 [is_taxonomy] => 1 [is_create_taxonomy_terms] => 1 ) [pa_id_t20] => Array ( [name] => pa_id_t20 [value] => [position] => 2 [is_visible] => 1 [is_variation] => 1 [is_taxonomy] => 1 [is_create_taxonomy_terms] => 1 ) [pa_id_es] => Array ( [name] => pa_id_es [value] => [position] => 3 [is_visible] => 1 [is_variation] => 1 [is_taxonomy] => 1 [is_create_taxonomy_terms] => 1 ) [pa_id_dlc] => Array ( [name] => pa_id_dlc [value] => [position] => 4 [is_visible] => 1 [is_variation] => 1 [is_taxonomy] => 1 [is_create_taxonomy_terms] => 1 ) [pa_id_dlcp] => Array ( [name] => pa_id_dlcp [value] => [position] => 5 [is_visible] => 1 [is_variation] => 1 [is_taxonomy] => 1 [is_create_taxonomy_terms] => 1 ) [pa_numero_de_catalogue] => Array ( [name] => pa_numero_de_catalogue [value] => [position] => 6 [is_visible] => 1 [is_variation] => 1 [is_taxonomy] => 1 [is_create_taxonomy_terms] => 1 ) [pa_id_voltage] => Array ( [name] => pa_id_voltage [value] => [position] => 7 [is_visible] => 1 [is_variation] => 1 [is_taxonomy] => 1 [is_create_taxonomy_terms] => 1 ) [pa_id_manufacturier] => Array ( [name] => pa_id_manufacturier [value] => [position] => 8 [is_visible] => 1 [is_variation] => 1 [is_taxonomy] => 1 [is_create_taxonomy_terms] => 1 ) [pa_id_marque] => Array ( [name] => pa_id_marque [value] => [position] => 9 [is_visible] => 1 [is_variation] => 1 [is_taxonomy] => 1 [is_create_taxonomy_terms] => 1 ) [pa_id_serie] => Array ( [name] => pa_id_serie [value] => [position] => 10 [is_visible] => 1 [is_variation] => 1 [is_taxonomy] => 1 [is_create_taxonomy_terms] => 1 ) [pa_id_famille] => Array ( [name] => pa_id_famille [value] => [position] => 11 [is_visible] => 1 [is_variation] => 1 [is_taxonomy] => 1 [is_create_taxonomy_terms] => 1 ) [pa_id_sous_famille] => Array ( [name] => pa_id_sous_famille [value] => [position] => 12 [is_visible] => 1 [is_variation] => 1 [is_taxonomy] => 1 [is_create_taxonomy_terms] => 1 ) [pa_id_installation] => Array ( [name] => pa_id_installation [value] => [position] => 13 [is_visible] => 1 [is_variation] => 1 [is_taxonomy] => 1 [is_create_taxonomy_terms] => 1 ) [pa_id_source] => Array ( [name] => pa_id_source [value] => [position] => 14 [is_visible] => 1 [is_variation] => 1 [is_taxonomy] => 1 [is_create_taxonomy_terms] => 1 ) [pa_id_type_de_source] => Array ( [name] => pa_id_type_de_source [value] => [position] => 15 [is_visible] => 1 [is_variation] => 1 [is_taxonomy] => 1 [is_create_taxonomy_terms] => 1 ) [pa_lumen_emis] => Array ( [name] => pa_lumen_emis [value] => [position] => 16 [is_visible] => 1 [is_variation] => 1 [is_taxonomy] => 1 [is_create_taxonomy_terms] => 1 ) [pa_wattage] => Array ( [name] => pa_wattage [value] => [position] => 17 [is_visible] => 1 [is_variation] => 1 [is_taxonomy] => 1 [is_create_taxonomy_terms] => 1 ) [pa_description] => Array ( [name] => pa_description [value] => [position] => 18 [is_visible] => 1 [is_variation] => 1 [is_taxonomy] => 1 [is_create_taxonomy_terms] => 1 ) [pa_prix_budget] => Array ( [name] => pa_prix_budget [value] => [position] => 19 [is_visible] => 1 [is_variation] => 1 [is_taxonomy] => 1 [is_create_taxonomy_terms] => 1 ) [pa_lien_photo] => Array ( [name] => pa_lien_photo [value] => [position] => 20 [is_visible] => 1 [is_variation] => 1 [is_taxonomy] => 1 [is_create_taxonomy_terms] => 1 ) [pa_lien_specsheet] => Array ( [name] => pa_lien_specsheet [value] => [position] => 21 [is_visible] => 1 [is_variation] => 1 [is_taxonomy] => 1 [is_create_taxonomy_terms] => 1 ) [pa_photometrie] => Array ( [name] => pa_photometrie [value] => [position] => 22 [is_visible] => 1 [is_variation] => 1 [is_taxonomy] => 1 [is_create_taxonomy_terms] => 1 ) [pa_id_produit] => Array ( [name] => pa_id_produit [value] => [position] => 23 [is_visible] => 1 [is_variation] => 1 [is_taxonomy] => 1 [is_create_taxonomy_terms] => 1 ) [pa_id_actif] => Array ( [name] => pa_id_actif [value] => [position] => 24 [is_visible] => 1 [is_variation] => 1 [is_taxonomy] => 1 [is_create_taxonomy_terms] => 1 ) )
Is it because it’s taxonomy terms ?
Like I said in my previous message, I tried a lot of things, nothings work.
Why can’t I retrieve all the attributes in one call ?
Thanks!
I also tried this:
$attr = get_post_meta( $produit_id, ‘_product_attributes’ );
print_r( $attr );Same thing: all values are empty.
And I’m sure I have values in it because when I call the values one by one like this:
$product->get_attribute( ‘ID_Famille’ )
it works.This one works too:
get_the_terms( $produit_id, ‘pa_id_famille’)But I would really like to get all the attributes with one call, because it will help a lot for the loading time.
This one only returns the attributes, not the values of it:
wc_get_attribute_taxonomies()I don’t know what else I can try.
Thanks for your help.
Thanks Caleb! Instead of calling get_attribute 19 times, I could call get_attributes one time in the loop of each product. It will surely speed up the loading a lot! The problem is that the values are empty when I retrieved it with get_attributes!
…
[pa_id_famille] => Array
(
[name] => pa_id_famille
[value] =>
[position] => 11
[is_visible] => 1
[is_variation] => 1
[is_taxonomy] => 1
[is_create_taxonomy_terms] => 1
)[pa_id_sous_famille] => Array
(
[name] => pa_id_sous_famille
[value] =>
[position] => 12
[is_visible] => 1
[is_variation] => 1
[is_taxonomy] => 1
[is_create_taxonomy_terms] => 1
)[pa_id_installation] => Array
(
[name] => pa_id_installation
[value] =>
[position] => 13
[is_visible] => 1
[is_variation] => 1
[is_taxonomy] => 1
[is_create_taxonomy_terms] => 1
)[pa_id_source] => Array
(
[name] => pa_id_source
[value] =>
[position] => 14
[is_visible] => 1
[is_variation] => 1
[is_taxonomy] => 1
[is_create_taxonomy_terms] => 1
)…
The thing I’m trying to achieved is an advanced filter (amazon style) which all the options are the attributes of the products (ID_Famille, ID_Sous_Famille, ID_Manufacturier, ID_Marque, etc.). I think I don’t have the choice to call all the attributes and put it in an array to manipulates it after. Your ideas are welcome! 🙂
My client want something very specific, I can’t use a widget.
Is there a way to get all the attributes of a product at the same time, without having to call get_attribute 18 times for each one?
Forum: Fixing WordPress
In reply to: Speed problem on loading, PHP code with multiple queries in loopThank you Tara, I’ll do that !
Forum: Plugins
In reply to: [WooCommerce] Need help! Create sub-lists in cartNo answer… Does that mean that i’m trying to achieve something impossible ?
Forum: Plugins
In reply to: [WooCommerce] Need help! Create sub-lists in cartUp !
Someone have an idea ? A plugin or the way to programmatically achieve this ?
Thank you in advance for your help !
Is it possible to get help about this problem ? It’s really messy, someone can put a fake postal code to calculate the shipping rate, than put the right one in the order and the shipping rate will stay the same. I think it’s a bug, but maybe it’s a misconfiguration on my side. Can someone help me ?
Am I at the right place to get help ?
Am I at the right place to get help ?
Does someone can help ? Thanks !
Does someone can help ? Thanks !
Forum: Plugins
In reply to: [Slideshow Gallery LITE] Order problemIt works ! Thanks Marietha !