Announcement

Collapse
No announcement yet.

is there a runtime version of the api for the category list load for products?

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

    is there a runtime version of the api for the category list load for products?

    for this CategoryList_Load_Offset_Product_Assigned
    is there a Runtime_CategoryList_Load_Offset_Product_Assigned

    which makes sure only active categories will get into the variable produced?

    I want to list all the categories a product belong to ( on the product detail page) but want to make sure that any inactive categories aren't in the list.

    #2
    I'm not seeing anything in the API for this. I think you'll have to check the loaded product's active field when it gets loaded, I presume while you're looping through the category's product list.

    Scott
    Need to offer Shipping Insurance?
    Interactive Design Solutions https://www.myids.net
    MivaMerchant Business Partner | Certified MivaMerchant Web Developer
    Competitive Rates, Custom Modules and Integrations, Store Integration
    AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
    My T-shirt Collection is mostly MivaCon T-shirts!!

    Comment


      #3
      There is

      Runtime_CategoryList_Load_All()

      and for specific categories you can presort out the active using
      Code:
      <mvt:if expr="ISNULL g.categories_offset"><mvt:assign name="g.categories_offset" value="0" /></mvt:if>
      <mvt:assign name="l.search" value="1" />
      <mvt:assign name="l.searchable_fields" value="'active'" />
      <mvt:do file="g.Module_Library_DB" name="l.loadcats" value="CategoryList_Load_Offset(g.categories_offset, l.search, l.searchable_fields, g.categories_max, g.categories_next_offset, l.settings:categories)" />
      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


        #4
        Thanks Bruce! I used that.

        Then tonight I was going through code to make it more readable and figured out this from a post that was helping someone figure out the active products a category. But for documentation sake here is what I did

        To find the number of active products in a category this loads the active products from a category into a variable as an array, then I used array elements to count the number of those products.

        <mvt:assign name="g.ke_catprods" value="0" />
        <mvt:do file="g.Module_Library_DB" name="l.success" value="Runtime_ProductList_Load_Offset_Category( l.settings:cat:id, g.Offset, '', g.NextOffset, g.ke_catprods)" />
        <mvt:eval expr="miva_array_elements(g.ke_catprods)" />

        Comment

        Working...
        X