0 Replies Latest reply on Jan 10, 2008 9:01 PM by ClayD

    Passing A List To The Struct, Not Just A Single Value

    ClayD Level 1
      I need for my structure to go through a list, not just one value and I can't see how to get it to work. Say for example the offer code is 8 and someone has 2 8's that apply...it is only accepting 1 and the other goes unnoticed. Would someone please help me figure this out before I bite all of my fingernails off. I'm attached a .cfm of the page, but here's the code as well I'm talking about. What am I doing wrong?


      <cfelseif currentOffer.saleCodeType_id EQ 8>
      <!--- This is a "specific items" offer. These are combinable. --->
      <cfquery name="qryApplySpecificItems" datasource="#REQUEST.db#">
      UPDATE shoppingCart_lineItem
      SET price = price - (price * #currentOffer.parameter#),
      title = title + ' - DISCOUNT PRICE',
      expireDate = saleCode.endDate,
      salecode_id = saleCode.saleCode_id
      FROM shoppingCart_lineItem
      INNER JOIN saleCode ON (saleCode.saleCode_id = #currentOffer.id#)
      LEFT JOIN product_viewType ON (shoppingCart_lineItem.product_id = product_viewType.product_id)
      INNER JOIN product ON (shoppingCart_lineItem.product_id = product.product_id)
      LEFT JOIN product_studio ON (shoppingCart_lineItem.product_id = product_studio.product_id)
      LEFT JOIN list_product ON (shoppingCart_lineItem.product_id = list_product.product_id)
      WHERE shoppingCart_lineItem.cart_id = '#cookie.cartid#'
      AND ((is_PrimaryOnly != 1 AND product_viewType.viewType_id = saleCode.viewType_id) OR (is_PrimaryOnly = 1 AND product.viewType_primary_id = saleCode.viewType_id)
      OR saleCode.viewType_id IS NULL)
      AND (product_studio.studio_id = saleCode.studio_id OR saleCode.studio_id IS NULL)
      AND (product.productType_id = saleCode.productType_id OR saleCode.productType_id IS NULL)
      AND (list_product.list_id = saleCode.list_id OR saleCode.list_id IS NULL)
      AND shoppingCart_lineItem.expireDate is NULL
      AND (shoppingcart_lineItem.formatCode NOT IN ('SD', 'SM', 'SR'))
      </cfquery>

      <cfquery name="qryCartTotal" datasource="#REQUEST.db#">
      SELECT SUM(ISNULL(MPDPrice,price) * quantity) AS cartTotal
      FROM shoppingCart_lineItem
      WHERE cart_ID = '#COOKIE.cartID#'
      </cfquery>
      <cfset totalnotax = 0>
      <cfif IsNumeric(qryCartTotal.cartTotal)>
      <cfset totalnotax = qryCartTotal.cartTotal>
      </cfif>

      <cfif currentoffer.list_id NEQ "">
      <cfset REQUEST.upsellList = currentoffer.list_id>
      </cfif>


      <cfset cmd = ArrayAppend(offerslist, currentOffer)>
      <cfif currentOffer.salecode EQ usersalecode>
      <cfset codevalid = 1>
      </cfif>

      __________________________________________________________________________________________ __