Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

How To Get Id Rate Topic   - - - - -

 
  • ooaykac
  • Senior Member
  • Members
  • Join Date: 22-Nov 12
  • 289 posts

Posted 02 August 2019 - 09:42 AM #1

<input type="hidden" name="product_data[category_ids]" value="" />
                
   
    
    <select id="product_categories_add_6523"
    
        class="cm-object-selector cm-object-categories-add input-large"
                            

                        name="product_data[category_ids][]"
        data-ca-enable-images="true"
        data-ca-enable-search="true"
        data-ca-load-via-ajax="true"
        data-ca-page-size="10"
        data-ca-data-url="http://localhost/admin.php?dispatch=cce_paket_yonetimi.get_orders_list"
        data-ca-placeholder="Type to search..."
        data-ca-allow-clear="false"
        data-ca-close-on-select="false"
        data-ca-ajax-delay="250"
        data-ca-allow-sorting="1"
        data-ca-escape-html="false"
        data-ca-dropdown-css-class="select2-dropdown-below-categories-add"
        data-ca-required="true"
        data-ca-select-width="100%"
        data-ca-repaint-dropdown-on-change="true"
        data-ca-picker-id="categories_product_categories_add_6523"
        
    >

I have an ajax form like above. How to get IDs?

 

Because I want it change to this: 

 

name="{$select2_name}[$id]"

 

So I want to put IDs as array key.

 

 



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11322 posts

Posted 02 August 2019 - 04:56 PM #2

Is this in a loop of category id's?  Would need more info on the context of this code.  Generally the current category id is {$category_id} but this is sometime short-handed to something different like {$catid} or similar....

 

Look at the template code that generates this id 

product_categories_add_6523

 

You'll see something like

product_categories_add_{$id}

 

Whatever it is is what you will probably want for your id.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.