Wordpress : Get assigned data value from defined variables - wordpress

I am working in an e-commerce site built with WordPress. I want to assign a zip code to each city in the country as users tend to misspell the names.
So I want it in a way that each time the type a city it's zip code appears.
Example when i type in New York I should have 00012 pop up.
Any suggestion would be welcomed.
Thanks

I have used one plugin please follow this plugin this will help to get zip code you need to do bit custom design if you need
here is link https://wordpress.org/plugins/simple-locator/
Their parent demo is here: https://locatewp.com/

Related

Scraping the gender of clothing items

Looking for advice please on methods to scrape the gender of clothing items on a website that doesn't specify the gender on the product page.
The website I'm crawling is www.very.co.uk and an example of a product page would be this - https://www.very.co.uk/berghaus-combust-reflect-long-jacket-red/1600352465.prd
Looking at that page, there looks to be no easy way to create a script that could identify this item as womenswear. Other websites might have breadcrumbs to use, or the gender might be in the title / URL but this has nothing.
As I'm using scrapy, with the crawl template and Rules to build a hierarchy of links to scrape, I was wondering if it's possible to pass a variable in one of the rules or the starting_URL to identify all items scraped following this rule / starting URL would have a variable as womenswear? I can then feed this variable into a method / loader statement to tag the item as womenswear before putting it into a database.
If not, would anyone have any other ideas on how to categorise this item as womenswear. I saw an example where you could use an excel spreadsheet to create the start_urls and in that excel spreadsheet tag each row as womenswear, mens etc. However, I feel this method might cause issues further down the line and would prefer to avoid it if possible. I'll spare the details of why I think this would be problematic unless anyone asks.
Thanks in advance
There does seem to be a breadcrumb in your example, however for an alternative you can usually check the page source by simply searching your term - maybe there's some embedded javascript/json that can be extract?
Here you can see some javascript for subcategory that indicates that it's a "womens_everyday_sports_jacket".
You can parse it quite easily with some regex:
re.findall('subcategory: "(.+?)"', response.body_as_unicode())
# womens_everyday_sports_jacket

Web automation with R code

Is it possible to get information from a url by making search on it, under R with any package?
I would like to make a loop for searching different code on the url and click on a precise place to write the code and to download document. A software does that, Actionaz, but I don't manage to make a loop with different code executing one after one.
Thank's,
Xavier
I found on forum "RSelenium" package like you suggest but it is not avalable on the CRAN ? I will see the over packages. I would add some informations of what i would do to know if it's realy possible on not ^^ :
1/open the url : http://hydro.eaufrance.fr/selection.php?consulte=rechercher
2/clic on the search region (precise point on screen)
3/type a name of station the first : "K0120020"
4/Search it on the website by clic on buton search
5/Select the station found with a clic
6/an over clic to get access to the data
7/Select the year on a dawn drop menu
8/Export data by clic on buton export

Webform submission: how to send the translation of a variable by mail

In a Drupal project, i have a basic weborm. As soon as the user submits one, an email is send with all the things he just wrote.
Example:
Imp_First_Name:%value[firstname]
Imp_Last_Name:%value[lastname]
Imp_City:%value[lastname]
Imp_Country:%value[country]
Imp_Email:%value[email]
Imp_Subject:%value[subject]
I have a problem on this line:
Imp_Subject:%value[subject]
Subject contains what the user have selected within a select list. My problem is when the website is set to chinese, all is written in chinese obviously but i don't want the chinese version to be sent. I need the english one.
For example :
In my webform, the user has the choice between 3 countries:
Afghanistan|阿富汗
Afrique du Sud|南非
Albanie|阿尔巴尼亚
I need the country name in latin alphabet ! How can i manage to do this?
thanks in advance for your help
It's a tricky one...
There is substitution and also two possible template layers. One comes from webform and second comes from mailsystem / mail handler module.
I'm assuming that the substitution is done before the template layer so the t() function should be applied either within a hook on that level or within the proper template file.
Debugging with XDebug would really help to solve the issue.

How to add fictional category wordpress

I'm trying to do something, on wordpress which i'm not sure is possible.
So basically, I'm using Magic fields for two things. I've created a panel called "Member", and another one called "Member actuality". I've created two categories, member and member actuality which I've binded too magic fields post.
When I go on category (site.com/category/member) member I have the list of all my members.
When I click on one of my members (site.com/memberName) I have the description of the member. So for the moment everything is ok.
Now what I want to do is find a way too display actuality of one member. Maybe something like : (site.com/actuality/member) But I have no clue on how to do that. So if someone can help me.
I'm not sure i've explained it right, so please if you didn't understand ask me to reformulate.
Thanks for your future help
I found a way to do go throu this.
I've first created a new tag when a post was added, and that allowed me to use the tag directory which i didn't used before !
!

Wordpress variable

I just think about that, easy to do in non cms site, but in wordpress site... i like to know YOUR approach to that problem
I have a BIG site (200 pages)... and at a lot of place, the info#something.com, the 000-000-0000 telephone and send your check to 123 easy street, Canada...
all that email, telephone, and address... should reside in one place (a post or a var) and when you need to insert it you should used the short code [tel] or [email].... but how...
is there a plusgin that can define var, or a tutorial to do that... do you only have to change it ONE for the whole site..
Any idea is welcome.... now, find and remplace is my friend !...
thanks in advance
You could try the Custom Config plugin:
http://wordpress.org/extend/plugins/custom-configs/
It will allow you to create custom global variables that are contained within the CMS (otherwise you'd be declaring these variables within the template config).
Usage to output a variable onto the page would be something like:
<?=get_config('myVariable','default')?>

Resources