Announcement

Collapse
No announcement yet.

Search and Replace - what category?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Search and Replace - what category?

    When using Search and Replace in the admin, I often get results in category headers. But the results are labeled like this:

    c12-header

    c17-header

    c1043-header

    Those are not category codes that I use. How do I translate that into actual category codes?

    Thanks for any help.
    Doug
    Using Miva Merchant since 2004
    StoreSMART.com
    ScrapSMART.com

  • Not a 100% sure but I think the number is the category ID. Not really helpful if you want to find it but maybe Miva will update the free module and contain the code instead.
    Andreas Toman
    PCINET, LLC

    Miva Merchant Design, Development, Integration & Support
    We built over 200 Miva Merchant stores!
    Miva shopping cart design & integration service and see our Portfolio!


    e-mail: [email protected]
    web: www.pcinet.com
    LinkedIn: Andreas Toman
    phone: (786) 250-2056 (Miami, FL)

    Comment


    • Yes they are cat ids.
      Bruce Golub
      Phosphor Media - "Your Success is our Business"

      Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
      phosphormedia.com

      Comment


      • Although a bit annoying that the category name isn't visible directly from Template Search and Replace, you can get the category name using the following snippet of code that you paste in your dev tools console on any admin.mvc page (like Template Search and Replace) - just make sure to enter the index you're trying to look up:

        Code:
        var categoryIndex = ; // this is the value (a number) that appears in template search and replace (e.g., if c112, set categoryIndex = 112)
        
        CategoryIndex_Load_ID(categoryIndex, '', '', function(response) {
            var displayIndex = response.data.index;
        
            CategoryList_Load_Query( '', '', '', '', function(categoryList){
                console.log(categoryList.data.data[displayIndex].name);
            });
        });
        Last edited by new_user2018; 05-16-18, 09:23 AM.

        Comment


        • Thanks for the reply. Would you be able to elaborate? I'm not familiar with the dev tools console.

          In Chrome, I go to my website (any particular page?), I open up the console and throw in this code:

          Code:
          var categoryIndex = 1628;
          
          CategoryIndex_Load_ID(categoryIndex, '', '', function(response) {
              var displayIndex = response.data.index;
          
              CategoryList_Load_Query( '', '', '', '', function(categoryList){
                  console.log(categoryList.data.data[displayIndex].name);
              });
          });
          After hitting Enter, I get this message:

          Code:
          VM705:3 Uncaught ReferenceError: CategoryIndex_Load_ID is not defined
              at <anonymous>:3:1
          Doug
          Using Miva Merchant since 2004
          StoreSMART.com
          ScrapSMART.com

          Comment


          • This may be easier:

            In the PLST page (if its not used, otherwise create a copy of it), in the Product List template, put in:

            <mvt:do file="g.Module_Library_DB" name="l.success" value="Category_Load_ID(g.thisCatID, category var)" /> <p><mvt:eval expr="l.settings:category:code;"/></p> Then call the page /mm5/merchant.mvc?Screen=PLST&thisCatID=1628 This would give you the cat code of the category.
            Bruce Golub
            Phosphor Media - "Your Success is our Business"

            Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
            phosphormedia.com

            Comment


            • Originally posted by VisHorizons View Post
              Thanks for the reply. Would you be able to elaborate? I'm not familiar with the dev tools console.

              In Chrome, I go to my website (any particular page?), I open up the console and throw in this code:

              Code:
              var categoryIndex = 1628;
              
              CategoryIndex_Load_ID(categoryIndex, '', '', function(response) {
              var displayIndex = response.data.index;
              
              CategoryList_Load_Query( '', '', '', '', function(categoryList){
              console.log(categoryList.data.data[displayIndex].name);
              });
              });
              After hitting Enter, I get this message:

              Code:
              VM705:3 Uncaught ReferenceError: CategoryIndex_Load_ID is not defined
              at <anonymous>:3:1
              I should have mentioned that sorry - you'll need to be on any admin.mvc page. Everything else looks good!

              Comment


              • Originally posted by Bruce - PhosphorMedia View Post
                This may be easier:

                In the PLST page (if its not used, otherwise create a copy of it), in the Product List template, put in:

                <mvt:do file="g.Module_Library_DB" name="l.success" value="Category_Load_ID(g.thisCatID, category var)" /> <p><mvt:eval expr="l.settings:category:code;"/></p> Then call the page /mm5/merchant.mvc?Screen=PLST&thisCatID=1628 This would give you the cat code of the category.
                Thanks for the reply. I do use PLST. (Levels uses it from the Featured Products on the home page.) So I made a copy. I'm not at all certain I did this correctly. Where do I paste this code? In the "Details" field or in the "Product List Layout" field? Either way, I get this error message: Error compiling template: Line 11: Expression compilation failed: Found additional argument ';' while looking for operator


                Originally posted by new_user2018 View Post

                I should have mentioned that sorry - you'll need to be on any admin.mvc page. Everything else looks good!
                Thanks! That works. I even figured out how to modify your code to give me the category code instead of category name.
                Doug
                Using Miva Merchant since 2004
                StoreSMART.com
                ScrapSMART.com

                Comment

                Working...
                X