콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다

I am trying to get products by id in Pos javascript.

Here is my code

***.js**

     get_promotional_products: function(options){

     var self = this;

     var offer_lines = this.pos.promo_running_configs.offer_line;

     var promo_product = [];

    _.each(offer_lines, function(line){

       _.each(line.offer_product_id, function(offer_product){

        var offer_product= 41;// It works

         promo_product.push(self.pos.db.get_product_by_id(offer_product));

         });

    });

    console.log('promo_product',promo_product);

    return promo_product;

    },

When pass `product_id` as variable i getting below error:

` TypeError: cur is undefined`

When I hard code a value it works fine.

How can I solve this?

아바타
취소
관련 게시물 답글 화면 활동
1
7월 19
9135
Popup window in pos 해결 완료
3
7월 17
16273
0
2월 24
1031
1
10월 18
5626
1
11월 24
693