Giter Site home page Giter Site logo

Comments (9)

stephenmcd avatar stephenmcd commented on July 30, 2024

Interesting issue :-) Need to give it some more thought.

In the meantime, yes there's a hook for custom slugify function which people mostly use to strip/replace non-ascii chars as you'd want to do here.

http://mezzanine.jupo.org/docs/configuration.html#slugify

from cartridge.

stephenmcd avatar stephenmcd commented on July 30, 2024

Most likely we'll just increase the field length, but let's think it over some more.

from cartridge.

stargazer33 avatar stargazer33 commented on July 30, 2024

http://mezzanine.jupo.org/docs/configuration.html#slugify

before I start experimenting with this, let's clarify something:
It is really the "url" field making problems, am I right?

If it's "url" - I would like to do transliteration only once, when products are created/edited in admin,
not later, not every time a product is displayed.

And, I would like to convert Unicode URL's into ASCII7 only for Product's, not for the complete website.
Is there a way to do this?

from cartridge.

stephenmcd avatar stephenmcd commented on July 30, 2024

The url field here belongs to an item in the cart - it gets copied to the cart item simply to display a link back to the product from the item in the cart. It needs to do this since the cart item does not contain a database relationship to the product it is for - product info (including its url) get copied to the cart item when it's added to the cart.

from cartridge.

stargazer33 avatar stargazer33 commented on July 30, 2024

I got this error again, and checked the SQL statement.
It is the shop_cartitem.description making troubles, not the url!

Yes, I have a lot of product variations, and the names are quite long and this leads to shop_cartitem.description > 200 char

from cartridge.

stephenmcd avatar stephenmcd commented on July 30, 2024

I guess we can increase its length too :-)

We'll also ensure that if the description length still exceeds the column size, the description gets truncated - no harm in this.

from cartridge.

stephenmcd avatar stephenmcd commented on July 30, 2024

Again though - like I mentioned in the other issue, it seems like you're pushing Cartridge way outside its intended usage.

from cartridge.

stargazer33 avatar stargazer33 commented on July 30, 2024

it seems like you're pushing Cartridge way outside its intended usage.

Well, may be you are right.

  1. Regarding the variation names (like "color" and "colors" itself) - yes, some names in my case are quite long, but, I think this impacts only "shop_cartitem.description" where variation names are concatenated.
    The length of this field can be increased, so it is not a big problem.
  2. The number of variations per product. Can be counted with the SQL statement:
    select count(*) from shop_productvariation where product_id in
    (select id from shop_product where slug='---your slug here----')
    In my case, after removing some of the options, this statement returns 144. I understand, thats a lot.
    May be Cartridge documentation can be updated, to include a warning, something like "avoid creating too much variations"

How can I optimize my site to work with this number of variations? (Only few products will have 144 variations, not all of them).
I think, the N1 this cycle in the shop/product.html:

{% for variation in variations %}
    
  • Everything in this cycle will be repeated number_of_variations times (144 in my case),
    so amount of HTML produced by this cycle should be minimized.
    I'm sure there are other places that can be tuned...
    Again, this could be documented...

  • from cartridge.

    stephenmcd avatar stephenmcd commented on July 30, 2024

    Can I suggest you take this discussion to the mailing list, thanks.

    from cartridge.

    Related Issues (20)

    Recommend Projects

    • React photo React

      A declarative, efficient, and flexible JavaScript library for building user interfaces.

    • Vue.js photo Vue.js

      🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

    • Typescript photo Typescript

      TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    • TensorFlow photo TensorFlow

      An Open Source Machine Learning Framework for Everyone

    • Django photo Django

      The Web framework for perfectionists with deadlines.

    • D3 photo D3

      Bring data to life with SVG, Canvas and HTML. 📊📈🎉

    Recommend Topics

    • javascript

      JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

    • web

      Some thing interesting about web. New door for the world.

    • server

      A server is a program made to process requests and deliver data to clients.

    • Machine learning

      Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

    • Game

      Some thing interesting about game, make everyone happy.

    Recommend Org

    • Facebook photo Facebook

      We are working to build community through open source technology. NB: members must have two-factor auth.

    • Microsoft photo Microsoft

      Open source projects and samples from Microsoft.

    • Google photo Google

      Google ❤️ Open Source for everyone.

    • D3 photo D3

      Data-Driven Documents codes.