Shopify Code Help

  • Started
  • Last post
  • 8 Responses
  • Nairn0

    Ok, I need to clarify.

    What I'd like is to be able to check 'last months overall sales' *, pull that through to the homepage, then have some javascript there do something with that value.

    So, say I have a site with 100 products, each of which have 50 units - I'm not interested in individual sales or stock rates - what I want is for the homepage to know what some overall sales value is. So, 30 products sold an average of 15 units each, for 450.

    I then do something with that 450 value.

    -

    * ok, that could be anything. I picked that as an example as if it's at all possible to do just this, then it should be possible to pull out other values too.

  • Nairn0

    - - - -
    2021
    - - - -

    Do any of you here know if it's possible to pull through some of the back-end admin sales data onto a Shopify site's homepage?

    Like, somehow add a number so that people can see how many units have been sold, etc?

    Thanks!

    • Sorry, more like "how many total units have been sold, across all product types".Nairn
    • https://apps.shopify…imbecile
    • hrmm. ok, so if they can do it, it is possible to pull that data out. But I only need one variable, for a specific, lateral reason.Nairn
    • How do I learn to do what they did? What is it I'm missing here? Is there some kind of SuperDev sub-layer to Shopify development?Nairn
    • at $4/month, at least two years would go by before it was worth my time to try to sort out the codingimbecile
    • that's slightly missing the point.Nairn
    • not my point. i don't have time to sort out the answer. i'm willing to pay someone who hasimbecile
    • maybe? https://community.sh…imbecile
    • var totalInventory = 100;
      assign var solditems = { current_variant.inve... } - { totalInventory }
      hotroddy
    • *current_variant.inv...hotroddy
  • pockets0

    now i need to figure our how to get the products to fill right on the layout..

    • you mark up closing <div> correctly i your product loop?BabySnakes
    • im going to be messing with it today.. past couple of days have made my brain turn into apple saucepockets
  • pockets0

    {% if customer and customer.tags contains 'KENTUCKY' %}
    {% assign customer_kentucky = true %}
    {% else %}
    {% assign customer_kentucky = false %}
    {% endif %}

    {% for product in collection.products %}
    {% include 'bold-product' with product, hide_action: 'skip' %}
    <div class="product-item-wrapper {% cycle 'first', '', '', 'last' %} col-sm-3 col-xs-6 ">
    {% if customer %}

    {% if product.tags contains 'KENTUCKY' %}
    {% if customer_kentucky %}
    {% include 'index_product-items' with collection.handle %}
    {% endif %}
    {% endif %}

    {% if product.tags contains 'INHOUSE' %}
    {% if customer_kentucky == false %}
    {% include 'index_product-items' with collection.handle %}
    {% endif %}
    {% endif %}

    {% if product.tags contains 'dropship' %}
    {% if customer_kentucky == true %}
    {% include 'index_product-items' with collection.handle %}
    {% endif %}
    {% endif %}

    {% else %}

    {% comment %}handle case where no customer exists {% endcomment %}

    {% endif %}

    </div>
    {% endfor %}

    • works, only took 9 hrspockets
    • but now the products that are hidden cause my layout to get all sorts of fuckedpockets
  • Mattjanz3n1

    It might be late and I'm reading wrong. I am also no coder but do look at Shopify code on the daily. It seems the only way for a product to prod_inhouse = true would be to have no tags at all.. seems weird. Also, can you do a double if statement, shouldnt it be elseif or close out each if before opening another?

    https://stackoverflow.com/questi…

    {% if product.tags contains 'KENTUCKY' or 'INHOUSE' %}
    {% assign prod_kentucky = true %}
    {% assign prod_inhouse = false %}
    {% else %}
    {% assign prod_kentucky = false %}
    {% assign prod_inhouse = true %}

    {% if customer_kentucky or prod_kentucky == false %}
    {% if customer_kentucky or prod_inhouse == false %}
    {% include 'index_product-items' with collection.handle %}
    {% endif %}
    {% endif %}

  • pockets1

    Mig:

    "as much as I would love to help, we don't support customer coding through support unfortunately. Even the theme is third party and 3rd party themes are quite different code wise than the themes built in house by shopify. Best course of action I would take is post on the forums, and worst case scenario, hire an expert. I have used heycarson.com in the past, they were very reasonable price wise and did a great job."

    bleh

    • aw yeah makes sense.
      maybe some qbn coder will show up and help
      Miguex
  • Miguex1

    I dont know code, but...
    shopify has an excellent customer service, I ran into some issues and was able to sort it out over the phone.

    • I think it's 24hs and free with a pro accountMiguex
    • ill probably have to look into this, thanks Migpockets
  • pockets0

    I know my code has a error somewhere because i can't*

  • pockets

    Hey Guys,

    Im looking to show products with the tag KENTUCKY and hide products tagged with INHOUSE if the customer is tagged with KENTUCKY. Ive followed a few tutorials but when it comes to hiding and showing multiple products based on multiple tags i get a bit lost. Heres my code:

    https://paste.ofcode.org/YfuTnTw…

    Any input on this would be appreciated, I know my code has a error somewhere because i can turn on a set of products and turn off a set of products based on one customer tag..

    thank you