Jump to content

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

Get The Data-Ca-Target-Id Value For All Pages Rate Topic   - - - - -

 
  • ismailix
  • Newbie
  • Trial users
  • Join Date: 24-Sep 21
  • 11 posts

Posted 29 December 2021 - 10:19 AM #1

how can I get the number to open data-ca-target-id="login_block1434" login modal on all pages



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 22940 posts

Posted 29 December 2021 - 01:58 PM #2

You can use the following selector

$("a[data-ca-target-id^='login_block']")

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 1210     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 4025     CS-Cart + YOUPI      USD 1459      Multi-Vendor Ultimate       USD 7500 (6000)


 
  • ismailix
  • Newbie
  • Trial users
  • Join Date: 24-Sep 21
  • 11 posts

Posted 30 December 2021 - 06:52 AM #3

<a title="{__("vendor_communication.contact_vendor")}" {if $settings.Security.secure_storefront != "partial"} class="cm-dialog-opener cm-dialog-auto-size ty-vendor-communication__post-write"{else}class="ty-vendor-communication__post-write"{/if} data-ca-target-id="login_block5669" rel="nofollow">

 

bunu buraya nasıl yazabilirim. teşekkürler



 
  • ismailix
  • Newbie
  • Trial users
  • Join Date: 24-Sep 21
  • 11 posts

Posted 30 December 2021 - 12:07 PM #4

I'm correcting my question.
This is exactly what I want to do
According to many pages, the number data-ca-target-id="login_block1434" --> 1434 is changing. cscart_bm_snapping from the database blocks/wrappers/onclick_dropdown in the wrapper column in the table.according to the data that says tpl, it gets snapping_id. We connect to cscart_bm_snapping in the database on all pages of snapping_id and add blocks/wrappers/onclick_dropdown in the wrapper column.we can show the snapping_id that says tpl. @eComLabs thanks


 
  • ismailix
  • Newbie
  • Trial users
  • Join Date: 24-Sep 21
  • 11 posts

Posted 06 January 2022 - 11:26 AM #5

don't have nobody to help me



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 22940 posts

Posted 06 January 2022 - 01:40 PM #6

Please clarify your goal in more details. What do you want to do?


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 1210     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 4025     CS-Cart + YOUPI      USD 1459      Multi-Vendor Ultimate       USD 7500 (6000)


 
  • ismailix
  • Newbie
  • Trial users
  • Join Date: 24-Sep 21
  • 11 posts

Posted 10 January 2022 - 08:38 AM #7

https://ibb.co/4Zct4x4print screen

i think this screenshot might help with what I mean.
I just want to dynamically get the digit after login_block here in data-ca-target-id=login_block156.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 22940 posts

Posted 10 January 2022 - 01:49 PM #8

How and where do you plan to get it? By javascript after the page is loaded?


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 1210     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 4025     CS-Cart + YOUPI      USD 1459      Multi-Vendor Ultimate       USD 7500 (6000)


 
  • ismailix
  • Newbie
  • Trial users
  • Join Date: 24-Sep 21
  • 11 posts

Posted 11 January 2022 - 08:22 AM #9

How and where do you plan to get it? By javascript after the page is loaded?

yes, it can be, or it can be with a simpler smarty, if you have a method, I can try



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 22940 posts

Posted 11 January 2022 - 01:26 PM #10

For js use solution from post #2. You can get list of all divs which ID starts with "login_block"


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 1210     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 4025     CS-Cart + YOUPI      USD 1459      Multi-Vendor Ultimate       USD 7500 (6000)


 
  • ismailix
  • Newbie
  • Trial users
  • Join Date: 24-Sep 21
  • 11 posts

Posted 12 January 2022 - 07:22 AM #11

<script>$("a[data-ca-target-id^='login_block']")</script>
 
when we wrote this to the tpl file like this, it didn't work. Would you please give us some information on how to write


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 22940 posts

Posted 12 January 2022 - 02:37 PM #12

Try something like

 

<script>
(function(_, $) {
        $(document).ready(function(){
               $("a[data-ca-target-id^='login_block']").each(function() {
                       console.log($(this).attr('id'));
               });
        });
}(Tygh, Tygh.$));
</script>

then check console in the developer console of your browser

 

(!) Not tested


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 1210     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 4025     CS-Cart + YOUPI      USD 1459      Multi-Vendor Ultimate       USD 7500 (6000)


 
  • ismailix
  • Newbie
  • Trial users
  • Join Date: 24-Sep 21
  • 11 posts

Posted 13 January 2022 - 07:45 AM #13

https://ibb.co/SnDFG37

 

gave an undefined error



 
  • kinterosJ
  • Newbie
  • Trial users
  • Join Date: 03-Apr 22
  • 4 posts

Posted 05 April 2022 - 03:58 PM #14

According to many pages, the number data-ca-target-id="login_block1434" --> 1434 is changing. cscart_bm_snapping from the database blocks/wrappers/onclick_dropdown in the wrapper column in the table.according to the data that says tpl



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 22940 posts

Posted 06 April 2022 - 01:35 PM #15

https://ibb.co/SnDFG37

 

gave an undefined error

 

This is not error. Looks like the element does not have ID attribute


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 1210     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 4025     CS-Cart + YOUPI      USD 1459      Multi-Vendor Ultimate       USD 7500 (6000)