woocomerce categories, title information inside a tag

This topic is: resolved

 

Thank you for contacting me. Please note that I live in the GMT+3 time zone - responses might be delayed by this.

This topic has 7 replies, 2 voices, and was last updated 1 year, 9 months ago by Szabi – CodeRevolution.

Viewing 7 reply threads
  • Author
    Posts
    • #7078


      frontrow
      Participant
      Post count: 3

      Hi, I wanted to ask 2 questions about the plugin:

      1) I want scrape and save products in a specific category of woocommerce, when I want to do it with 3rd categories (category with 2 parents), they do not appear in the “Additional post category” box, I try to put the id in the box below “Autocreated categories parent category id” but it doesn’t create it either. Is there a way to import them?

      2) is it possible for the scrape to take the “title” information that is inside an “a” tag?

      I attach images.

      Thankyou!

      Attachments:
      You must be logged in to view attached files.
    • #7082


      Szabi – CodeRevolution
      Keymaster
      Post count: 4620

      Hello,

      First of all, thank you for your purchase.

      1. WooCommerce product categories are not regular categories, but they are custom taxonomies. So, they need to be added using the ‘Post Custom Taxonomies’ settings field. The categories have the following custom taxonomy ID: product_cat

      So, to add categories, you can do as follows:

      Post Custom Taxonomies
      product_cat => YOUR_CATEGORY

      2. Yes, this should be possible using Regex. You can try to write a Regex expression which matches this tag. You can test your Regex here: https://regexr.com/

      Let me know if this helped.

      Regards, Szabi – CodeRevolution.

    • #7105


      frontrow
      Participant
      Post count: 3

      <div>

      1. Hi, the custom taxonomy work good, but when i have 2 categories with the same name, the plugin takes the first categorie with this name. Have i any way to use a “CATEGORY ID” instead of “CATEGOY NAME”?

      </div>
      <div></div>
      <div>

      1. I am trying to get the value with this regular expression: (?<=<a\s.*?\title=”).+?(?=“), but nothing happens, I do a test trying to put this information in the body content, but I really need to use this information to create a Woocmerce custom attribute “Brand”. Do you think this is possible?

      </div>

    • #7113


      Szabi – CodeRevolution
      Keymaster
      Post count: 4620

      Hello,

      1. Yes, this is possible, you can also use the numeric taxonomy value IDs to which you wish to assign custom categories.

      2. Please send me the URL of the site from which you want to extract the above Regex and I check on it.

      Regards.

    • #7115


      frontrow
      Participant
      Post count: 3

      https://blsfashion.com/en/product/banador-blanco-alexander-mcqueen-calaveras-negras/

      I just need the value of title to make an atribute “brand” with this name.

      Attach a picture

      Thanks

      Attachments:
      You must be logged in to view attached files.
    • #7117


      Szabi – CodeRevolution
      Keymaster
      Post count: 4620

      You can try Regex:

      #<meta property=”product:brand” content=”([^”]*?)”\s?\/>#i

    • #7118


      frontrow
      Participant
      Post count: 3

      sorry but i dont understand where do i put this code

    • #7121


      Szabi – CodeRevolution
      Keymaster
      Post count: 4620

      Please use as below:

       

      Custom Shortcode Creator
      brand => regex @@ #<meta property=”product:brand” content=”([^”]*?)”\s?\/>#i

      Post Custom Taxonomies: 
      pa_brand => %%brand%%

       

      Please note that you need to create a custom product attribute called Brand.

      Regards.

Viewing 7 reply threads

The topic ‘woocomerce categories, title information inside a tag’ is closed to new replies.