ibrahimpak
Forum Replies Created
-
Hello,
Thanks for your answer.
Let’s say
<title>TITLE</title>
is the code then$product = get_page_by_title( $data['title'], OBJECT, 'product' ) )
In this way, if the product names in the file are in the database, will the uploaded not be done?
This is exactly what I want, if one of the product names in the file already exists, don’t load it.
- This reply was modified 2 years, 9 months ago by ibrahimpak.
- This reply was modified 2 years, 9 months ago by ibrahimpak.
Forum: Plugins
In reply to: [WooCommerce Address Book] Setting the address book as defaultError messages are blank when “labels” are deleted.
My problem is solved.
Forum: Plugins
In reply to: [WooCommerce Address Book] Setting the address book as defaultYes, I just checked elsewhere and the error messages seem fine.
I think the problem stems from some of the methods I use.
Thank you.
Forum: Plugins
In reply to: [WooCommerce Address Book] Setting the address book as defaultMy question above is no longer valid and I ran into a new problem.
Error messages do not provide the required information.
I added two separate images about it, is it possible to fix it in the update?
- This reply was modified 2 years, 12 months ago by ibrahimpak.
I tried the following XPath way and it works perfectly.
/Product[Price[1][not(starts-with(.,"1,") )]]
In this way, prices such as “1.00”, “2.00”, “3,00” etc. can be excluded.
This suggestion solved my problem and thank you for everything!
Hi @aakash8
Your answer shows no problem. That’s why I guess “.” We have to get used to using separators.
As another method, I did use filter “not contains” for example “1,00” prices like, sample: /Product[Price[1][not(contains(.,”1,”))]]
But this time “11,00” , “21,00” , “31,00” , “41,00” , “51,00” etc. affected prices.
Maybe it would be useful if the filter was limited to “1,00” prices only.
- This reply was modified 3 years ago by ibrahimpak.
The snippet works as I want it to.
Prices of 50 and above are rounded.
Prices of 50 and below are left as they are.
Thanks for everything!
Thank you @aakash8
For prices of 50 and above, the code works as I want it to.
It does not take into account prices below 50. It leaves it blank.
Is it possible to leave them as they are?
I tried it and unfortunately couldn’t get it to work for the price of 50 and above.
I will be grateful for your help.
function round_price( $price = null, $multiplier = 1, $nearest = .01, $minus = 0 ) { if ( !empty( $price ) ) { // strip any extra characters from price $price = preg_replace("/[^0-9,.]/", "", $price); // perform calculations if (round_price($price > 50)) { echo "true"; } else { echo "false"; } return ( round ( ( $price * $multiplier ) / $nearest ) * $nearest ) - $minus; } }
Hello @wpallimport
I tried the code and the titles look great.
I would appreciate it if you could help me with the price rounding price limit.
Thank you so much!
Also below is another code. How can this code only work for prices of 50 and above?
function round_price( $price = null, $multiplier = 1, $nearest = .01, $minus = 0 ) { if ( !empty( $price ) ) { // strip any extra characters from price $price = preg_replace("/[^0-9,.]/", "", $price); // perform calculations return ( round ( ( $price * $multiplier ) / $nearest ) * $nearest ) - $minus; }
@aakash8 I want one more suggestion from you.
I’m using the code snippet below to clean up the ID number at the end of the header.
function my_fix_title( $title ) { $title = explode( ' ', $title ); array_pop( $title ); return implode( ' ', $title ); }
The code works but sometimes it also deletes words.
What can I do to have it clear only digits in the range 0-9?
Below is an example of a file. The header output will be as follows.
1. Title ) TRANSFORMACION Tam Otomatik ?anta Boy
2. Title ) TRANSFORMACION Carson Trafik Emniyet
3. Title ) ModaCar Magnus Trafik Emniyet Seti (only this works right)
<?xml version="1.0"?> <Products> <Product> <Code>7440000714281</Code> <ProductType>As?l</ProductType> <MainProductCode/> <Barcode>7440000714281</Barcode> <UnitInStock>11</UnitInStock> <IsActive>1</IsActive> <ModelNumber>HBCV00000P6NDP</ModelNumber> <Mark>Transformacion</Mark> <ProductName>TRANSFORMACION Tam Otomatik ?anta Boy ?emsiye </ProductName> <Description> ?emsiyeler </Description> <Price>53,20</Price> <Currency>YTL</Currency> <Vat>18</Vat> <Desi>1</Desi> <MainGroupCode>21201</MainGroupCode> <MainGroup>Unisex Aksesuar ve Bak?m</MainGroup> <EndGroupCode>21136</EndGroupCode> <EndGroup>?emsiye</EndGroup> <PictureCode>https://www.arabayaservis.com/productimages/164797/big/7430000714281.jpg</PictureCode> </Product> <Product> <Code>7440000428900</Code> <ProductType>As?l</ProductType> <MainProductCode/> <Barcode>7440000428900</Barcode> <UnitInStock>6</UnitInStock> <IsActive>1</IsActive> <ModelNumber>HBCV000014NRB5</ModelNumber> <Mark>Transformacion</Mark> <ProductName>TRANSFORMACION Carson Trafik Emniyet Seti </ProductName> <Description> Emniyet Setleri </Description> <Price>115,66</Price> <Currency>YTL</Currency> <Vat>18</Vat> <Desi>1</Desi> <MainGroupCode>21130</MainGroupCode> <MainGroup>ARAC AKSESUAR</MainGroup> <EndGroupCode>12954</EndGroupCode> <EndGroup>Trafik Yol Yard?mc? ürünler</EndGroup> <PictureCode>https://www.arabayaservis.com/productimages/177923/big/be480024-2d00-4abb-b5ba-3a94327a7a65.jpg</PictureCode> </Product> <Product> <Code>7410000428901</Code> <ProductType>As?l</ProductType> <MainProductCode/> <Barcode>74100004289012</Barcode> <UnitInStock>6</UnitInStock> <IsActive>1</IsActive> <ModelNumber>HBCV000013B5HJ</ModelNumber> <Mark>ModaCar</Mark> <ProductName>ModaCar Magnus Trafik Emniyet Seti 428901</ProductName> <Description> Emniyet Setleri </Description> <Price>160,93</Price> <Currency>YTL</Currency> <Vat>18</Vat> <Desi>1</Desi> <MainGroupCode>21130</MainGroupCode> <MainGroup>ARAC AKSESUAR</MainGroup> <EndGroupCode>12954</EndGroupCode> <EndGroup>Trafik Yol Yard?mc? ürünler</EndGroup> <PictureCode>https://www.arabayaservis.com/productimages/175176/big/7410000428901.jpg</PictureCode> </Product> </Products>
This is how I ensured that there were two codes in one column.
[my_fix_title(str_replace("Test", "Test2", {ProductName[1]}))]
- This reply was modified 3 years ago by ibrahimpak.
Hello @aakash8
Thanks for your advice on xPath.
I also have two separate edits for the header, how can I put them together?
[str_replace(",", "", {title[1]})]
[my_fix_title({title[1]})]
First of all, you should know that I am not a professional.
Let’s say I have an installation and ID:5 will be loaded again and want to be included in ID:5.
The shortest way to do this is to set ID:6 to ID:5 in the “wp_pmxi_imports” table in the mysql database. In this way, the new installation will be done as ID:5.
Note: Make sure to create a backup beforehand.