Coder Social home page Coder Social logo

attribute_image_swap's People

Contributors

mc12345678 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

zen4all

attribute_image_swap's Issues

PHP 7.3 compatibility

There are a few things that are not yet PHP 7.x fully functional that could use touching/improvement.

Help Understand Install SQL

The install SQL could use a little more explanation within the file for those that are using this. There is really little that is needed to support the image swap; however, at some point there was an added feature incorporated that generates an attribute link. While not well understood, it does require a SQL statement and it appears if executed multiple times will produce multiple instances of the same thing.
While this could be better controlled with an installer, the software doesn't seem to have reached the level of maturity or need to requiring such an installer.

Checkboxes and radio buttons add html line break

When setting the attribute image style to the added values of 6, 7, or 8, the text of these selection types incorporates a <br /> into the text and moves a portion to a new line. This is unexpected when switching to the image swap style from a value of 0, 1, or 2.

IH5 installed and image swap does not occur

With IH5 installed, attempting to swap an image causes the image not to swap and results in an error on the catalog side similar to:

PHP Fatal error:  Uncaught Error: Call to a member function notify() on null in ...\includes\modules\YOUR_TEMPLATE\main_product_image.php:19
Stack trace:
#0 ...\includes\classes\ajax\zcAttrib_prod_info.php(48): require_once()
#1 ...\ajax.php(76): zcAttrib_prod_info->swap_image()
#2 {main}
  thrown in ...\includes\modules\YOUR_TEMPLATE\main_product_image.php on line 19

This is because the file includes\classes\ajax\zcAttrib_prod_info.php incorporates the module file (require_once) and within the file is a notifier that does not have $zco_notifier defined. Therefore in order to support execution, $zco_notifier needs to be brought into the execution space. As a global variable to ZC, perhaps the best solution is to simply make $zco_notifier global within the calling function.

Improve Incorporation of zen_colorbox

The plugin zen_colorbox, available at https://www.zen-cart.com/downloads.php?do=file&id=1322 has undergone or shortly will undergo a slight change that would affect the colorbox feature. The principal change is in a file that could be incorporated with default values set and some of the returning values trimmed/parsed to remove excess JavaScript/jQuery. Ideally, when tagging onto another program, their interaction should be made more seamless and modular. Such a step should be taken here to possibly improve that code as well.

Remove modifications to language file

There's not really a need for language defines to be in the language file for the software being executed at least from a plugin portability stand point. It does reduce code usage and loading, but
makes installation more difficult.

The defines to display in the admin about the selections added by this plugin could be moved to a standalone file.

Investigate incorporation of other image handler related software

#This plugin offers the ability to swap the attribute image into the main product image location; however, store owners may have also incorporated other image handling type software that would allow some other next action to occur with the main product image. Therefore, with that swap, the plugin should allow some level of control/generation to support continued operations such as the other plugin(s).

Note, that because the plugin only modifies screen information and not the database information related to a product, that image popup/display is through the combination of the main product image and additional images related code and not necessarily/through just the main product image code as seen in the tpl_modules_main_product_image.php file.

Generally speaking at this point, the plugin already considers the modified image "name" of say Image Handler v4, though may not include the popup on hover aspect (yet). A next image related plugin is zen_colorbox (https://github.com/mc12345678/zen-colorbox) the backbone of which continues to be supported by the open source community and is being updated to support plugins such as this relatively easily incorporating the operation(s).

So, keep an eye out for ways to either incorporate or for methods to be incorporated and support improved operation(s) and capabilities.

Install SQL does not execute correctly in multiple lines

The install SQL if used (as it applies to "links") is in some cases spread across 2 or more lines. At least in testing with a local copy errors were produced. This may be/have been different for the uploaded copy; however, want to make the experience consistent.

Should join the multiple lines into one.

Changes made to support Zen Cart versions are not obvious

While this code seems to only really touch one core file, it is not easy to keep the installation clear about what needs changing and what needs simply to be replaced. It seems that it would be a little clearer if the code were split into folders where the core set of files are installed from one folder and the modified file(s) are in another.

This also would support the request of the software distribution team to not have sql related files and instruction files in the root of the software distribution package which means that those installing the software would likely have a cleaner installation.

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.