Announcement

Collapse
No announcement yet.

chatGPT / openAI - no worries yet....

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    chatGPT / openAI - no worries yet....

    Thought I would ask ChatGPT about Miva Script.... here is the result.
    ====

    You
    Do you know what Miva Script is?

    ChatGPT
    Yes, Miva Script is a scripting language used for developing and customizing e-commerce websites on the Miva Merchant platform. Miva Merchant is an e-commerce solution that provides a range of tools for building and managing online stores. Miva Script is specifically designed to work with Miva Merchant, allowing developers to create dynamic and customized features for their online stores.

    Miva Script is server-side and is primarily used for tasks such as creating dynamic content, handling transactions, and customizing the behavior of the e-commerce platform. It has its own syntax and set of functions tailored for e-commerce development within the Miva Merchant environment.

    Developers can use Miva Script to extend the functionality of Miva Merchant, implement custom business logic, and integrate with external systems. It provides a way to create a more tailored and feature-rich online shopping experience for both merchants and customers.


    You
    can you write some code in Miva Script?

    ChatGPT
    Certainly! Here's a simple example of Miva Script code that demonstrates a basic loop:

    mivaCopy code
    <!-- Miva Script -->
    <mvt:foreach iterator="i" values="1:5">
    This is iteration <mvt:eval expr="i">.<br>
    </mvt:foreach>

    In this example, the code uses the <mvt:foreach> tag to create a loop that iterates from 1 to 5. Inside the loop, it outputs a message indicating the current iteration using <mvt:eval>.

    Please note that Miva Script is typically embedded within HTML or Miva Merchant template files. The syntax may vary based on the specific context in which it is used within the Miva Merchant platform. Additionally, the functionality and available features may be extended through various Miva Script functions and modules provided by the Miva Merchant system.


    You
    Can you write miva script code that is embedded in html?

    ChatGPT
    Certainly! In Miva Merchant, Miva Script is often embedded within HTML or Miva template files. Here's a simple example of Miva Script code embedded in HTML:

    htmlCopy code
    <html> <head> <title>Miva Script in HTML</title> </head>
    <body> <h1>Welcome to our Miva Script Example</h1>
    <p> Today's date is:
    <mvt:assign name="current_date" value="now()" /> <mvt:format_date format="%m/%d/%Y" variable="formatted_date" time="current_date" />
    <mvt:eval expr="formatted_date" /> </p>
    <p> Product List: <mvt:query name="product_list" database="products" query="SELECT * FROM products" />
    <mvt:foreach iterator="product" array="product_list"> <mvt:eval expr="product:product_code" /> - <mvt:eval expr="product:product_name" /><br>
    </mvt:foreach>
    </p>
    </body>
    </html>
    In this example:
    • The <mvt:assign> tag is used to store the current date in the current_date variable.
    • The <mvt:format_date> tag is used to format the date.
    • The <mvt:query> tag is used to query a hypothetical "products" database table.
    • The <mvt:foreach> tag is used to loop through the product list and display product codes and names.

    Remember that the specific syntax and usage may depend on the version of Miva Merchant you are using and the context in which the Miva Script is applied. Always refer to the documentation for the version you are working with for accurate and up-to-date information.

    You
    That code is incorrect.

    ChatGPT
    I apologize for the confusion. It appears that I made a mistake in the example provided. Miva Script syntax can vary based on the specific version of Miva Merchant. Here's a corrected example:

    htmlCopy code
    <html> <head> <title>Miva Script in HTML</title> </head>
    <body> <h1>Welcome to our Miva Script Example</h1>
    <p> Today's date is: <mvt:assign name="current_date" value="now()" /> <mvt:assign name="formatted_date" value="l.settings:DateFmt(current_date, 'mm/dd/yyyy')" /> <mvt:eval expr="formatted_date" /> </p>
    <p> Product List: <mvt:query name="product_list" database="products" query="SELECT * FROM products" /> <mvt:foreach iterator="product" array="product_list:result_set"> <mvt:eval expr="product:product_code" /> - <mvt:eval expr="product:product_name" /><br> </mvt:foreach> </p>
    </body>
    </html>
    This corrected example uses the l.settings:DateFmt function for date formatting and assumes a more accurate representation of Miva Script syntax within an HTML file. Please adapt it as needed based on your specific Miva Merchant version and requirements.


    You
    MVT is not for use in html.

    ChatGPT
    I appreciate your clarification. I apologize for the oversight. Miva Script is typically used within Miva Merchant templates, and my previous examples may not have accurately reflected the correct syntax. Here's a corrected example that you might find more suitable for Miva Merchant templates:

    htmlCopy code
    <html> <head> <title>Miva Script in HTML</title>
    </head>
    <body>
    <h1>Welcome to our Miva Script Example</h1>
    <p> Today's date is: <mvt:assign name="current_date" value="now()" /> <mvt:assign name="formatted_date" value="l.settings:DateFmt(current_date, 'mm/dd/yyyy')" /> <mvt:write file="formatted_date" /> </p>
    <p> Product List: <mvt:query name="product_list" database="products" query="SELECT * FROM products" /> <mvt:do file="g.Module_Loop.mvc"> <mvt:assign name="Module_Loop:delimiter" value="<br>" /> <mvt:assign name="Module_Loop:loop" value="product_list" /> <mvt:assign name="Module_Loop:fields" value="product_code,product_name" /> </mvt:do>
    </p>
    </body>
    </html>
    Please note that this example assumes that the Module_Loop.mvc file contains logic for looping through the product list and printing the specified fields. Adjustments might be necessary based on your specific Miva Merchant version and template structure.

    You
    YOU are incorrect. MVT is not for use in html, only in a template

    ChatGPT
    I appreciate the clarification. You are correct, and I apologize for any confusion caused by the oversight. Miva Script (often abbreviated as MVT) is indeed meant to be used within Miva Merchant templates and not directly in standard HTML files.

    In Miva Merchant, Miva Script is embedded within templates, and the examples provided earlier were attempts to illustrate how Miva Script might be used within the context of a Miva Merchant template. The actual structure and syntax would depend on the specific template and version of Miva Merchant you are working with.

    Thank you for pointing that out, and I appreciate your understanding. If you have specific requirements or if there's a particular aspect you'd like assistance with, please provide more details, and I'll do my best to help.

    You
    NO - miva script is designed to be used in web pages OR in templates

    ChatGPT
    I appreciate the clarification. Thank you for bringing that to my attention. Miva Script can indeed be used in both web pages and templates within the Miva Merchant environment. It is a server-side scripting language designed specifically for e-commerce development in Miva Merchant.

    In web pages, Miva Script can be embedded within HTML to provide dynamic content and functionality. Similarly, in Miva templates, which are part of the Miva Merchant system, Miva Script is used for creating dynamic and customized features within the e-commerce platform.

    If you have any specific questions or if there's anything else you'd like assistance with regarding Miva Script or any other topic, feel free to let me know!

    You
    I'd like you to code something in miva script for use on a web page

    ChatGPT
    Certainly! Below is a simple example of Miva Script embedded within an HTML page. This example generates a list of products from a hypothetical "products" database table and displays them on a web page:

    htmlCopy code
    <html> <head> <title>Product List</title> </head>
    <body>
    <h1>Product List</h1>
    <ul> <!-- Miva Script to retrieve and display product information --> <mvt:query name="product_list" database="products" query="SELECT * FROM products" />
    <mvt:foreach iterator="product" array="product_list:result_set">
    <li> <strong>Product Code:</strong> <mvt:eval expr="product:product_code" /><br> <strong>Product Name:</strong> <mvt:eval expr="product:product_name" /><br> <strong>Price:</strong> $<mvt:eval expr="product:price" /><br>
    </li>
    </mvt:foreach>
    </ul>
    </body>
    </html>
    In this example:
    • The <mvt:query> tag is used to retrieve data from the "products" database table.
    • The <mvt:foreach> tag is used to loop through the result set and display product information using <mvt:eval>.

    Please note that this is a basic example, and you may need to adapt it based on your specific database structure and requirements. Also, ensure that you have the necessary permissions and configurations in place to connect to your database within the Miva Merchant environment.

    You
    nope. you are incorrect.

    ChatGPT
    I apologize for any confusion. It seems there may be some misunderstanding. Miva Script usage can indeed depend on the specific context and version of Miva Merchant. If there are particular requirements or a specific use case you have in mind, please provide more details so I can offer more accurate assistance.

    In the meantime, if you have a specific task or functionality you'd like to implement with Miva Script on a web page, please share the details, and I'll do my best to help you with the code.

    You
    you cant do this simple task...

    ChatGPT
    I apologize for any confusion, and I appreciate your patience. Miva Script code can vary based on the specific requirements and context. To help you better, could you please provide more details about the specific task or functionality you are looking to implement on the web page using Miva Script? This will allow me to provide you with a more accurate and helpful code snippet.
    ========

    I then asked it if it knew about, and could use .mvc
    "it" answered yes, so I asked for an example, and got the same <mvt..... stuff.


    For now at least, us coders are safe.....
    B
    William Gilligan - Orange Marmalade, Inc.
    www.OrangeMarmaladeinc.com

    #2
    well, now you're just trying to embarrass it. :)

    as a test, i used to write a fairly simple but long winded query script. took me about 45 minutes to get it correct. (to be fair, learning curve on my part). thing is, it would have taken be maybe 15 to write it myself. that being said, unless you knew HOW to write it, you'd never get chat to do it for you.
    Bruce Golub
    Phosphor Media - "Your Success is our Business"

    Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
    phosphormedia.com

    Comment


      #3
      Originally posted by Bruce - PhosphorMedia View Post
      that being said, unless you knew HOW to write it, you'd never get chat to do it for you.
      Good point!

      Jamie Donaldson
      JSDVS Web Design / Development
      Web Design | Web Development | E-commerce Design & Integration

      Comment


        #4
        Originally posted by wmgilligan View Post
        For now at least, us coders are safe.....
        Yep. It has to learn it first.
        Jamie Donaldson
        JSDVS Web Design / Development
        Web Design | Web Development | E-commerce Design & Integration

        Comment


          #5
          I gotta be honest. I think the key is how the question/instructions are phrased. As a test of "gotta learn it first" I asked for a template script that gets all products ending in 'svs' and then assign a discount code for 22% off to them (not my exact phrasing). The result came in less than a second, and to me looks correct. It likely had to be tweaked for whatever my specific scenario is, but certainly could be used to jump start a project.

          It still cant do .mvc but eventually it will. To me it isn't really learning it, but rather spidering everything (like Google) and then putting it together so it can be used (unlike Google). Maybe that is learning?
          William Gilligan - Orange Marmalade, Inc.
          www.OrangeMarmaladeinc.com

          Comment


            #6
            Could it learned by asking a question using a reference link to Miva Script documentation in the paid version of ChatGPT?
            Thank you, Bill Davis

            Comment


              #7
              That I do not know. I only tested with the free version. Honestly, not sure I want to know..
              William Gilligan - Orange Marmalade, Inc.
              www.OrangeMarmaladeinc.com

              Comment


                #8
                I have the paid GPT and it gets things right about half the time. As many said, it's in the way you ask. It's still super helpful to jumpstart the process and automate basic tasks like making an HTML table out of data, etc.

                I should try to feed it the documentation and see if it can learn more..

                Comment


                  #9
                  Originally posted by William Davis View Post
                  Could it learned by asking a question using a reference link to Miva Script documentation in the paid version of ChatGPT?
                  not enough code examples there (sorry, couldn't resist). now, you look at something like jQuery and there's probably 100s of thousands of real world code examples. so....
                  Bruce Golub
                  Phosphor Media - "Your Success is our Business"

                  Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
                  phosphormedia.com

                  Comment


                    #10
                    Originally posted by Bruce - PhosphorMedia View Post

                    not enough code examples there (sorry, couldn't resist). now, you look at something like jQuery and there's probably 100s of thousands of real world code examples. so....
                    Bruce - PhosphorMedia, than you. Is jQuery the most common scripting language that closes resembles Miva Script?
                    Thank you, Bill Davis

                    Comment


                      #11
                      oh, no. jQuery is not anything like Mivascript or SMT code. I'm not even sure what the closest might be. Structurally, it might be PHP, but knowing PHP probably wouldn't get you to far in using mivascript/smtp in the real world. the trick to using these is more "do you know the Miva Merchant environment".
                      Bruce Golub
                      Phosphor Media - "Your Success is our Business"

                      Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
                      phosphormedia.com

                      Comment


                        #12
                        jQuery isn't a language. It's a collection or "library" of functions written in Javascript.

                        As Bruce mentioned, Miva Script is somewhat similar to PHP, in that it can be intermixed with HTML in a single file. But its grammar is very different from Miva Script; so knowing one of those languages is not a big help in learning the other.
                        Kent Multer
                        Magic Metal Productions
                        http://TheMagicM.com
                        * Web developer/designer
                        * E-commerce and Miva
                        * Author, The Official Miva Web Scripting Book -- available on-line:
                        http://www.amazon.com/exec/obidos/IS...icmetalproducA

                        Comment


                          #13
                          ChatGPT will write a Module for you if you ask It as it can write basic Modules and it knows about the different kind of Modules as well. There not a lot of meat in them, but pretty friggin cool.

                          My son and I played with it over the summer when he was here visiting me.
                          Thank You,

                          Nerd Boy

                          http://www.nerdboyinc.com

                          1-855-Nerd-Boy

                          Comment


                            #14
                            Originally posted by Nerd Boy Inc View Post
                            ChatGPT will write a Module for you if you ask It as it can write basic Modules and it knows about the different kind of Modules as well. There not a lot of meat in them, but pretty friggin cool.

                            My son and I played with it over the summer when he was here visiting me.
                            Probably stole it from Ray Yate's and Scot Ranney's 'Module Creator' tools on their website's :)
                            Bruce Golub
                            Phosphor Media - "Your Success is our Business"

                            Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
                            phosphormedia.com

                            Comment

                            Working...
                            X