ilyapokrov
Forum Replies Created
-
Forum: Plugins
In reply to: [Import any XML, CSV or Excel File to WordPress] Overwrite valuesAfter several attempts, I still managed to achieve the result =)
I wrote down the formula as follows:
[my_map_data_Size({param[@name="Size"]},my_map_data_Category({typePrefix[1]}))]
There is also a drawback of this method – a very long catalog update. Apparently such formulas slow down the update process very much.
- This reply was modified 4 years, 1 month ago by ilyapokrov.
Forum: Plugins
In reply to: [Import any XML, CSV or Excel File to WordPress] Overwrite values@wpallimport,
But what to do when you need to use the previously obtained value using a formula?
For example, I rewritten using the “Category” function, and in order to determine the “size” attribute I need to use the resulting category.
I have already written the code, checked it – it works. But I cannot display it in the attribute. Tried it like this:
Get a category
[my_map_data_Category({typePrefix[1]})]
Get the attribute
[my_map_data_Size({param[@name="Size"]},[my_map_data_Category({typePrefix[1]})])]
Forum: Plugins
In reply to: [Import any XML, CSV or Excel File to WordPress] Overwrite values@wpallimport,
That’s what I need! Many thanks! Thank you very much!Forum: Plugins
In reply to: [Import any XML, CSV or Excel File to WordPress] Regular price / Sale priceThis code works as it should!
For the Regular Price input:
[IF({oldprice[boolean(.)]})]{oldprice[1]}[ELSE]{price[1]}[ENDIF]
For the Sales Price input:
[IF({oldprice[boolean(.)]})]{price[1]}[ENDIF]
Thank you very much!
- This reply was modified 4 years, 1 month ago by ilyapokrov.
Forum: Plugins
In reply to: [Import any XML, CSV or Excel File to WordPress] Regular price / Sale price@wpallimport,
I think you understood me correctly! Unfortunately, this code did not work. The price is still not displayed at all.Set the Unique Identifier to something that’s the same for each record that belongs to the same product, but different for each product.
Enable “Choose which data to update” -> “Attributes” -> “Don’t touch existing Attributes, add new Attributes”: https://d.pr/i/Cd5n8E.I thought about it too, but this option will not work.
In this case, if the product is not in the file, then the import will not remove the attribute. And when the visitor follows the link to buy this product, it will be out of stock.You’d have to find a plugin that adds support for it and import into that plugin.
I could not find such a plugin, although I searched for a very long time. Maybe you know the name and advise me?
@wpallimport,
Thank you.
But as a consequence of this, the next question is partner goods. When you add a variable product, I don’t see where to specify the affiliate link.
How to be in this situation?Forum: Plugins
In reply to: [Import any XML, CSV or Excel File to WordPress] Two functions in one@wpallimport,
I am very sorry, but I did not understand anything =)))
Can you show it with my example?Forum: Plugins
In reply to: [Import any XML, CSV or Excel File to WordPress] Overwriting Attribute Values@wpallimport,
I coped with the task with code like this:function my_map_data_Probnik( $data ) { $map = array( 'Male' => 'For Male', 'Women' => 'For women', ); if (array_key_exists($data, $map)) { return $map[$data]; } if (mb_strpos($data, 'children') !== false) { return 'for children'; } if (mb_strpos($data, 'toddlers') !== false) { return 'for babies'; } return null; return ( array_key_exists( $data, $map ) ) ? $map[ $data ] : $data; }
I am sharing this code with you, suddenly it will be useful to someone.
But there is a nuance. I don’t know if you can help me with this or not.
For the speed of the site, I connected a VPS cloud hosting.
I noticed that when I use this feature my hosting often drops the connection and the site gets an error – No database access.
The hosting says that the problem is in the site scripts – they need to be optimized. RAM of 1 GB is not enough for this job.
I specifically checked on a YML file, which contains only 5 products. And I don’t think this operation wastes more than 1 GB of RAM.Forum: Plugins
In reply to: [WooCommerce] Hide standard output of categories@robertghetau,
I removed the standard output of categories with code like this:add_action( 'pre_get_posts', 'bbloomer_remove_products_from_shop_page' ); function bbloomer_remove_products_from_shop_page( $q ) { if ( ! $q->is_main_query() ) return; if ( ! $q->is_post_type_archive() ) return; if ( ! is_admin() && is_shop() ) { $q->set( 'post__in', array(0) ); } remove_action( 'pre_get_posts', 'bbloomer_remove_products_from_shop_page' ); }
I have displayed the categories I want using this shortcode:
[product_categories parent="90" columns="1000"]
But in this case the caption is displayed “No products were found matching your request.”, which I hid with dislpay: none.I coped with the task, but I think that this is not a completely correct solution.
Forum: Plugins
In reply to: [Import any XML, CSV or Excel File to WordPress] Two functions in one@wpallimport,
Did I understand you correctly?For example, there are such parameters:
<param name = "Gender"> Female </param> <param name = "Gender"> Male</param> <param name = "Gender"> Female, Male </param> <param name = "Gender"> Male, Female </param> <param name = "Gender"> Male, Female, Child </param>
That is, I need to write and translate each value manually?
[my_map_data ({param [@name="Gender"]})]
function my_map_data ($ data) { $ map = array ( 'Male' => 'for men', 'Female' => 'for women', 'Female, Male' => 'for women|for men', 'Male, Female' => 'for women|for men', 'Male, Female, Child' => 'for women|for men|for children', ); return (array_key_exists ($ data, $ map))? $ map [$ data]: $ data; }
It happens that new parameter values appear. And if I have not specified them, then in the end I will get some kind of nonsense if I do not specify this parameter for translation.
Forum: Plugins
In reply to: [Import any XML, CSV or Excel File to WordPress] Error in cron – status: 403@wpallimport,
My server load has grown a lot. Even when I disable the trigger. Do I understand correctly that running every 2 minutes also creates a load on the server?Forum: Plugins
In reply to: [WooCommerce] Remove all categories on the homepage.@senff,
Are you going to answer the question?
Or are you only needed to give useless replies ?!Forum: Plugins
In reply to: [WooCommerce] Remove all categories on the homepage.@seank123,
I don’t know much about the code.
I understand that you need to write a function, something like:
If it is is_shop, then remove category outputForum: Plugins
In reply to: [WooCommerce] Remove all categories on the homepage.@seank123,
This is not a solution to the problem. In this case, they are displayed, but hidden. The code is loaded on the site and slows down the site loading time.I advise you to redo it) Now experienced specialists will definitely help us and we will solve this problem together!