texts: How can I duplicate the category page in a custom module?

texts:
Originally I was trying to copy over all of the xml from vendor/magento/module-catalog/view/frontend/layout/catalog_category_view.xml into my own xml file. This route was not working.

So I have now changed to where I am extending my controller from \Magento\Catalog\Controller\Category\View.

<?php
namespace My\Custom\Controller\ProductGrid;

use Magento\Framework\App\Action\Context;
use Magento\Catalog\Model\Design;
use Magento\Catalog\Model\Session;
use Magento\Framework\Registry;
use Magento\Store\Model\StoreManagerInterface;
use Magento\CatalogUrlRewrite\Model\CategoryUrlPathGenerator;
use Magento\Framework\View\Result\PageFactory;
use Magento\Framework\Controller\Result\ForwardFactory;
use Magento\Catalog\Api\CategoryRepositoryInterface;
use Magento\Catalog\Model\Layer\Resolver;

/**
 * Class HeaderA
 * @package My\Custom\Controller\Header
 */
class ProductGridA extends \Magento\Catalog\Controller\Category\View
{
    /**
     * @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface|\Magento\Framework\View\Result\Page
     */
    public function execute()
    {
        return parent::execute();
    }
}

And then inside my xml file I have

<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <update handle="catalog_category_view"/>
    <body>

    </body>
</page>

My page is loading, but the content is coming out blank. I believe I need to set a category to be pulled up somehow but I can not figure out the best way to do this.


texts:
We switched to full https recently but now we found that the url's in google ( which still point to http ) get redirected to the homepage.

It also is a multi domain installation.

Is there a correct htaccess change to be made so the deeplinks get redirected correctly to there https version?


texts: Increase product image size in Amasty's One Step Checkout Magento 2

texts:
Amasty put their product image size at 75px in the 'Your Order 'Order Summary area, and mine is displaying at half that due to some css I can't locate.
Please put an item into the cart on their demo site at https://one-step-checkout-m2.magento-demo.amasty.com/checkout/
Is this possible to modify the image size via CSS? Or do I need to override the extension file? I can't seem to locate it either.


texts: I am working on a module where I have to implement one to many relationship. I have one table for series with id and name field and one table series_product where I have id, series_id, product_id and I want to make relation in models like we do in MVC. can we implement this on model??


texts: Magento 2.4 Products are not showing in category - Elastic Search enabled

texts:
I have recently installed a Magento 2.4 for a client, configured elastic search and everything worked well until I created a few additional store views (my assumption).
Now the products are visible everywhere, on the home page, in search results, by direct URLs but not in the categories.
Any clue will be appreciated.


texts:
i am trying to update products and all the products give me the same error and is

Invalid input datetime format of value '1/01/1970'

can someone help me. thanks


texts: Magento Cart: Thumbnail Images Don't Appear in Chrome or Safari

texts:
I'm unable to see my product thumbnails on the cart page when I use Chrome or Safari. They do however appear in Firefox. The line rendering these images is in app/design/frontend/my_package/my_theme/template/checkout/cart/item/default.phtml

<?php if ($this->hasProductUrl()):?><a href="<?php echo $this->getProductUrl() ?>" title="<?php echo $this->htmlEscape($this->getProductName()) ?>" class="product-image"><?php endif;?><img src="<?php echo Mage::helper('catalog/image')->init($_product, 'small_image')->resize(75,75); ?>" width="75" height="75" alt="<?php echo $this->htmlEscape($this->getProductName()) ?>" /><?php if ($this->hasProductUrl()):?><?php endif;?>

Despite being sized at 75px X 75px, the image is rendered in the browser at 0px X 75px, making it invisible. Inspecting the code shows that it is indeed there, it's just the wrong size. My first thought was an issue with class="product-image", but removing the class didn't change the output.

I've also tried a couple different ways of pulling up the image, all of which give the exact same result - a 0px X 75px image:

$_product = $_item->getProduct();
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image') ?>" width="75" height="75" alt="<?php echo $this->htmlEscape($this->getProductName()) ?>" />

Any ideas what might solve this issue?


texts:
Some files such as the product listing template (with multiple nested ifs) are hard to edit without error.

I would like to be able to format phtml files with indenting appropriate for php and html, ideally as a git hook or as a command line way, e.g. in Vim. Does anyone have any method for formatting phtml files that helps, and is there a 'Zend/Varien' coding style for these files to follow?

EDIT:

I am aware that you should have all of the code that should be in the block in the block and not do random sql queries in the template. What I would like is just an easy way to get reliable indentation.


texts: Retrieve all available shipping methods/carriers via REST

texts: We're looking for a way to generate a list of all available shipping method codes and shipping carrier codes via REST API. I'm only seeing this available via the cart but I'd like to be able to retrieve the list so that I could add the correct one to the cart. Does anyone know how this is possible?


texts: How to check /root/cron.php/ is working or not

texts:
I have create fedex module that complate the order status based on product delivery status and setup with /root/cron.php/.

but i don't know to check cron schedules are working or not. Any manual trick to check the cron are working or not?


texts: Magento 2 - How can I show subtotal on checkout page

texts:
On checkout page I want subtotal, shipping and grand total in both "Shipping" and "Payment" steps.

I have followed this https://magento.stackexchange.com/a/235329/31910 :

In view/frontend/requirejs-config.js:

var config = {
    config: {
        mixins: {
            'Magento_Checkout/js/view/summary/abstract-total': {
                'Vendor_Module/js/abstract-total-mixin': true
            }
        }
    }
};

In view/frontend/web/js/abstract-total-mixin.js:

define([], function () {
    "use strict";

    return function (target) {
        return target.extend({
            /**
             * @return {*}
             */
            isFullMode: function () {
                if (!this.getTotals()) {
                    return false;
                }

                return true;
            }
        });
    }
});

After this I have got Shipping amount and Grand total, but there is no subtotal appearing.

My question is, How can I show subtotal in checkout?


texts:
I have this problem:

www.prova.com
www.prova.com/it/
www.prova.com/eng/

i want my guest entry directy into website 2)


texts: Magento 2 - How to get product Manage Stock attribute value

texts: I want to check is "Manage Stock" is set as Yes or No with specific product. Can anyone help us to get value of product "Manage Stock" attribute value.


texts: PayPal Instant Payment Notification Warning

texts:
I have been recieving this email from paypal

  Hello XXXXXXXXXX,

  Please check your server that handles PayPal Instant Payment
  Notifications (IPN). IPNs sent to the following URL(s) are failing:

  https://XXXXXXXXXX/paypal/ipn/

  If you do not recognize this URL, you may be using a service provider
  that is using IPN on your behalf. Please contact your service provider
  with the above information. If this problem continues, IPNs may be
  disabled for your account.

  Thank you for your prompt attention to this issue.

  Thanks, PayPal

  ---------------------------------------------------------------- PROTECT YOUR PASSWORD

  NEVER give your password to anyone, including PayPal employees.
  Protect yourself against fraudulent websites by opening a new web
  browser (e.g. Internet Explorer or Firefox) and typing in the PayPal
  URL every time you log in to your account.

  Please do not reply to this email. We are unable to respond to
  inquiries sent to this address. For immediate answers to your
  questions, visit our Help Centre by clicking "Help" located on any
  PayPal page or email.

  PayPal is committed to your privacy, learn more about our privacy
  policy: https://www.paypal.com/ca/webapps/mpp/ua/privacy-full

I do not know why I am receiving this as all my Paypal Payments seem to be going through fine. I only use this paypal account for my magento store too (no ebay or other selling channels). And on magento I am only utilizing express checkout right now. How would I find the source of the problem and fix it?

Thanks


texts: Adding a File Field to my System.xml - File Not Uploading

texts:
Here's my system.xml field definition:

<fields>
    <upload translate="label">
        <label>Upload Latest</label>
        <comment><![CDATA[This file gives you a more up-to-date BIN database. Please upload one regularly to stay ahead.]]></comment>
        <frontend_type>file</frontend_type>
        <backend_model>adminhtml/system_config_backend_file</backend_model>
        <upload_dir>var/uploads</upload_dir>
        <sort_order>50</sort_order>
        <show_in_default>1</show_in_default>
        <show_in_website>0</show_in_website>
        <show_in_store>0</show_in_store>
    </upload>
</fields>

The field shows successfully, but for some reason, when I browse for a file and click Save Config, it just redirects me to the Dashboard, there's no communication with any models, it literally just loads the dashboard.

How can I debug this issue successfully?

Update
After some additional digging, it appears to accept some files.

The particular file I'm looking to upload is a CSV that is 11.9 Mb. I've tried a small Jpg and it uploads successfully.

Could be to do with Filesize or File Type. How do I specifically enable CSV and increase the File Size limit to 20Mb?


texts: 500 Internal server error on payment redirect after placing order

texts:
This is a follow-up question to the Why “failed to open stream” error?. I am integrating Zaincash module in magento. I am using this extension from git. Now when I am clicking on Place Order button on magento's default onepage checkout page, page is redirected to zcash/standard/redirect/ and getting 500 Internal server error.

When I debugged, I found following code in app/code/local/WTC/Zcash/Model/Standard.php:

public function getOrderPlaceRedirectUrl()
{
    return Mage::getUrl('zcash/standard/redirect');
}

And in app/code/local/WTC/Zcash/controllers/StandardController.php action following code:

public function redirectAction()
{

    $session = Mage::getSingleton('checkout/session');
    $session->setHdfcStandardQuoteId($session->getQuoteId());
    $order = $this->getOrder();

    if (!$order->getId()) {

        $this->_forward('failurerefresh');
        return;
    }

    $order->addStatusToHistory(
        $order->getStatus(),
        Mage::helper('hdfc')->__('Customer was redirected to hdfc')
    );
    $order->save();

    $this->getResponse()
        ->setBody($this->getLayout()
            ->createBlock('hdfc/standard_redirect')
            ->setOrder($order)
            ->toHtml());

    $session->unsQuoteId();
}

I think, its controller is faulty. I didn't get what is hdfc here? Can anyone help me please?


texts: Check if product attribute value is null Magento 2

texts:
I want to show the below code only if product attribute value is not null

The attribute to check is price_range

CURRENT CODE

The price is not available for this product, it is approximately <?php echo $_helper->productAttribute($block->getProduct(), $block->getProduct()->getPriceRange(), 'price_range') ?>*. *Price shown is for guidance purposes only.

Can anyone please suggest an update with an if statement to get this working?


texts: I am facing a issue relted to custom url in 1.9.0.1

texts:
After every Re-Indexing from admin panel one of the category url is changed in this manner.

before Re-Index : cushion-covers -9.html
After Re-Index : cushion-covers -11.html

and its changing from cushion-covers-2.html

What I am thinking is.

Can I truncate core_url_rewrite (so that it becomes totally empty)
and re-index again. Is it good solution. (My consern is does it harm any functionality ).

Kindly suggest can  i do this or any better solution.

UPDATE

I tried above method but it start again from cushion-covers-2.html

what to do ?


texts: Magento 2 - GetLastRealOrderId is always returning null

texts:
I am trying to get the last order so that I can load the order by increment id but

`$this->_checkoutSession->getLastRealOrder()->getIncrementId()`;

is  returning null.


texts: Installing Apache Solr on EC2 instance and connecting it with shared hosting server

texts:
I have magento running on a shared hosting. Magento search functionality sucks so i wanted to install Apache Solr, but my shared hosting does not allow it.
Is there any way I can install it on EC2 and connect my shared hosting with it.

P.S I don't want to transfer my hosting to EC2 completely.


texts: best way to integrate customer with login and pass from another website?

texts:
My customer have already a big website whose have 200.000,00 customer registered.
Now, we make an store with products related with the site. He wants to integrate the 200000 followers registered (with email and pass) on magento store.

What is the best way to do it?


texts: How to change 'is required' field in Bundle Items on frontend

texts:
1) I have a combination of product i.e. Product A + Product B both will be bought together and cannot be sold individually.

2) Once customer purchases above bundle product of combination Product A + Product B on the repurchasing of same product again the customer should be able to buy Product A and leave Product B means they can be sold individually.

How can this be achieved?

Many thanks


texts: Using cron job in Magento my database is exported (.csv). In my server every 5 minutes but in this way server becomes full quickly. Is it possible to override previous .csv  in server and not create a new .csv every 5 minutes?


texts: Magento 2 - Hide Products with no Images via PHP SQL Query

texts:
I have an SQL query that i run on the database manually which checks the catalogue for products that do not have an image and hides them, i want to run this via cron so have created a php with the following content:

    <?php

$servername = "localhost";
$username = "xxx";
$password = "xxx";
$dbname = "xxx";

// Create connection
$conn = new mysqli($servername, $username, $password,$dbname);

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

// Script to run

$sql=

update catalog_product_entity_int m;
left join eav_attribute a on a.entity_type_id = 4 and a.attribute_id = m.attribute_id
set value = 2
where
a.attribute_code = 'status'
and m.entity_id in
(
select m.entity_id
from catalog_product_entity m
left join catalog_product_entity_media_gallery_value_to_entity a
on a.entity_id = m.entity_id
where a.value_id is null
)
;

if ($conn->query($sql) === TRUE) {
    echo "Record updated successfully";
} else {
    echo "Error updating record: " . $conn->error;
}

$conn->close();

?>

But I get this error: [PHP Parse error:  syntax error, unexpected 'catalog_product_entity_int' (T_STRING) in /home/public_html/modimages/hideimages.php on line 20

The query works fine when i put it directly on phpmyadmin so i am guessing i am missing something very simple.


texts: Magento 2.3.2 to 2.3.5 : Column 'shipping_name' cannot be part of FULLTEXT index

texts:
I tried upgrading a magento store from 2.3.2 to 2.3.5, but when i run

 php bin/magento setup:upgrade

I recieve a strange database error relating to a index on the sales_shipment_grid table:

SQLSTATE[HY000]: General error: 1283 Column 'shipping_name' cannot be part of FULLTEXT index, query was: ALTER TABLE `sales_shipment_grid` MODIFY COLUMN `entity_id` int(10) UNSIGNED NOT NULL   COMMENT "Entity ID", MODIFY COLUMN `increment_id` varchar(50) NULL  COMMENT "Increment ID", MODIFY COLUMN `store_id` smallint(5) UNSIGNED NULL   COMMENT "Store ID", MODIFY COLUMN `order_increment_id` varchar(32) NOT NULL  COMMENT "Order Increment ID", MODIFY COLUMN `order_id` int(10) UNSIGNED NOT NULL   COMMENT "Order ID", MODIFY COLUMN `order_created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT "Order Increment ID"

I checked the web for this error, and found some people saying that all the Encoding and Collation fields should be the same for this index.  But those all seem to be the same in this table (Encoding: cp1252 West Europe and Collation: latin1_swedish_ci).

Anybody encounter this issue before, or know a possible solution?

MySQL version is 5.7.26


texts: Custom design for products from a category

texts:
I want to set a different view for all the products from a category. I am using the default functionality from admin-> category-> custom design-> custom layout update:

<reference name="product.info">
<action method="setTemplate"><template>catalog/product/apparel_view.phtml</template></action>

I have tried the solution from Custom category design but I couldn't manage to make it work. If I go to the product page using the category in link it is fine (like http://xxxx.ro/store/apparel-accesories/mens-graphic-t-shirt), but otherwise the default view is seen(like http://xxxx.ro/store/mens-graphic-t-shirt).


texts: Product listing page layer navigation by color ,size etc

texts:
I am using magento CE 1.9.2.2.

First issue is when i am setting the category Is anchor to yes and then I am clicking on front end it show processing error. If is anchor set to no then front categories work fine.

Second i want to show the filter on product listing page by color ,size issue is i want to when i click on size it show all sizes in dropdown from where i select same is the color.

when category is anchor is yes clicking on category on front end getting this error:

a:5:{i:0;s:74:"Invalid method Mage_Core_Block_Text_List::(Array([0] => currency) )";
i:1;s:1571:"#0 [internal function]: Varien_Object->__call('', Array)
    #1 [internal function]: Mage_Core_Block_Text_List->('currency')
    #2 G:\xampp\htdocs\dev2\app\code\core\Mage\Core\Model\Layout.php(348): call_user_func_array(Array, Array)
    #3 G:\xampp\htdocs\dev2\app\code\core\Mage\Core\Model\Layout.php(2


texts: Full Tax Summary Display 2 tax but one result

texts:
When I display the full tax summary in my cart (and in checkout) I get the tax amount but for only the first tax have a value (the total of all tax)

The total cart amount is :34.98
The total of tax is 5.24

So the first tax (TPS 5%) should be 34.98$ * 0,05 = 1.75$
And the second tax (TVQ 9.975%) should be equal: 34.98 * 0,09975 = 3.49$

So the total is correct, but why I don't have the amount for each tax  ?

See image below:

Thank you


texts:
I want to replace the text of "The confirmation request has been sent", what is the best way to do it? create an module and overwrite this controller?
If yes, what is the correct path I should app/code or app/design?

thanks

/magento/module-newsletter/Controller/Subscriber/NewAction.php

NewAction.php

    private function getSuccessMessage(int $status): Phrase
{
    if ($status === Subscriber::STATUS_NOT_ACTIVE) {
        return __('The confirmation request has been sent.');
    }

    return __('Thank you for your subscription.');
}


texts:
I want a query to delete one category and all the associate values in all the tables.
In specific i need a query to delete all categories where value=null.

I tried it by code, but it doesn't work.


texts: Magento Admin Customer Edit Password not Work

texts:
The following error occure during password edit

  Fatal error: Uncaught Error: Call to a member function getBackend() on
  boolean in
  /var/www/vhosts/stormboy.com.au/httpdocs/app/code/core/Mage/Eav/Model/Entity/Abstract.php:1553
  Stack trace: #0
  /var/www/vhosts/stormboy.com.au/httpdocs/app/code/core/Mage/Customer/Model/Resource/Customer.php(240):
  Mage_Eav_Model_Entity_Abstract->saveAttribute(Object(Mage_Customer_Model_Customer),
  'password_create...') #1
  /var/www/vhosts/stormboy.com.au/httpdocs/app/code/core/Mage/Customer/Model/Customer.php(240):
  Mage_Customer_Model_Resource_Customer->changePassword(Object(Mage_Customer_Model_Customer),
  '*RWN2Q6q') #2
  /var/www/vhosts/stormboy.com.au/httpdocs/app/code/core/Mage/Adminhtml/controllers/CustomerController.php(367):
  Mage_Customer_Model_Customer->changePassword('*RWN2Q6q') #3
  /var/www/vhosts/stormboy.com.au/httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(418):
  Mage_Adminhtml_CustomerController->saveAction() #4
  /var/www/vhosts/stormboy.com.au/httpdocs/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254):
  in
  /var/www/vhosts/stormboy.com.au/httpdocs/app/code/core/Mage/Eav/Model/Entity/Abstract.php
  on line 1553


texts: Product page broken after upgrade to 2.3.2

texts:
We have recently upgraded Magento 2.3.0 to 2.3.2 and the frontend on product pages is broken.

The rest of the site appears to be working ok, but the product page is just loading a gallery loader, saying "Skip to the end of the images gallery"

You can view an example product page here:

https://staging.propmasters.net/dinosaurs-1991

Looking at the source, it appears the  isn't being loaded by the site.

The Current application mode is in developer, but it has always been in this mode, as we haven't launched it yet.


texts:
I'm trying to create a custom controller, but i have been having this error returned every time I try to run the module.

Uncaught Error: Call to undefined method Magento\Framework\App\Action\Action::construct()

Which is weird knowing that i've followed the exact process of creating controllers.

I've also tried looking for a similar case around the internet, but wasn't successful.

Here are the codes ive made so far:

=> module.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Jaycroll_Test" setup_version="2.2.0">
</module>

=> routes.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">

=> Write.php (the controller)

namespace Jaycroll\Test\Controller\Index;

use \Magento\Framework\App\Action\Action;

class Write extends Action
{
  public function __construct( \Magento\Framework\App\Action\Context $context ) {
     return parent::construct( $context );
  }
  public function execute()
  {
        var_dump("test");
        die('test index');
  }
}

Currently running Magento 2.2 on developer mode.
I can't simply run setup:di:compile as i need to modify the module from time to time (https://www.cadence-labs.com/2017/07/magento-2-run-setupdicompile/)


texts:
I need to add custom text field to "add review" form, for example email.

There are already some threads on web where people are asking the same thing, but none of them has a solid answer. Most suggest to modify core files directly, or run manual SQL queries.

If you know some open-source plugin that adds such feature, or you already implemented this somewhere, please share how you did it.

Thank you!


texts: How to get the ID of a custom attribute when having the custom attribute text value?

texts:
I want to update a custom attribute and I can do that like this:

$product = Mage::getModel('catalog/product')
    ->loadByAttribute('sku',"mysku");

$product->addAttributeUpdate('manufacturer', 281);
echo $product->getAttributeText('manufacturer');

In addAttributeUpdate() instead of passing 281 which is the ID
I only have an attribute text so I should get the ID of that attribute text and insert it in the place of 281

How can I do that?

$attrtext = 'myatttext';
$product->addAttributeUpdate('manufacturer', $attrtext->getId() /* ???????? */);


texts: Product image is not displaying on the list of products ratherdisplaying inside the custom block

texts:
kindly have a look on our site, first two new products are added with image but magento default logo was displaying. Where others are comes up with the theme demo database.

http://52.187.32.74/rahhams

if you open that product in the below link, it will show the actual image that we uploaded, i have tried with your sample image.

http://52.187.32.74/rahhams/chicken-biriyani.html

Let me know anything i have missed while adding the product.


texts: Magento2 downloadable product customoptions section position changing

texts:
can anyone help me to how to move customoptions section to below the product descriptions section.

Please find the screenshot below:

Thanks


texts: Homepage blocks not displaying after update to 1.9.3.1

texts: I just updated my Magento to 1.9.3.1 and so far I've noticed the blocks on my homepage in both the main content and the sidebar content are not displaying at all. They were displaying before the update just fine. I've noticed people saying to try adding permissions in System > Permissions > Blocks, but that page is missing in my backend. Is that page not available in 1.9.3.1?


texts:
I want to use MIGS 3rd party Hosted Solution to our magento 2 integration but
I am getting 400 response code error from http://migs.mastercard.com.au/vpcpay

I configured only MerchantId to send payment request. Moreover, there are two other options in the extension configuration namely 1) Secure Secret 2) Access Code. But our Bank denies to use it and replied, it will work with only MerchantId.

Any help would be appreciated.


texts: How to Implement Moneris Fraud Prevention Tools on our Magento site?

texts: I do not know where to look to enable fraud prevention tools on our magento site. I'd like to enable name and address lookup and everything else available except 'verified by visa'. Could someone point me in the right direction?


texts:
I copied my magento shop to an other domain and host.

Just downloaded the db and uploaded it in the new db.
copied all files in public html to new public html.

changed db credentials in local.xml and in the db changed core config to the correct secure and unsecure url.

But now the site on the new url looks like this:
www.cbd24.nl and it should look like this: www.mediaboxshop.nl

How to solve this.

Thanks.


texts:
I want to add google maps into my custom module page in magento but the script loaded from google server requires api key. I am able to add this url with the kay hardcoded like:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <link src="https://maps.googleapis.com/maps/api/js?key=MyApi-123Key" src_type="url" content_type="js" />
    </head>
</page>

But I am wondering is there a way to have this key set in the configuration and get it from the config table?


texts:
I have a task where i must implement a relatively involved crud module.

It will have a few different entities which will require a couple of different admin crud forms and the associated navigation items etc.

My question is, is this beyond the abillity of a beginner in Magento?  After reading about it, creating these admin grids etc seems very complicated - although also very repitive in some respects.

Can anyone with experience in creating these say if these are difficult or easy to create and if there are any specific tips?


texts: How can I add Track Button to Magento on frontend - Magento 1

texts: How can I add track button on sales/order/history/


texts:
I have added to links with following code in local.xml file.

<?xml version="1.0"?>
<layout version="0.1.0">
    <default translate="label" module="page">
        <reference name="top.links">
            <action method="addLink">
                <label>New Link</label>
                <url>#</url>
                <title>New Link</title>
            </action>
        </reference>
    </default>
</layout>

But "New Link" is showing twice in header links.Please suggest me a way.


texts:
We did an export of some old transactions, products and categories some time back. However there have been multiple updates to the data so a new export is required.

In order to do so we need to way to delete all products and transactions from the current Magento setup. How can we do that?

Would a flush similiar to this work in Magento 1,8 How to delete all sample data magento 1.9


texts: Setting up AWS RDS Read Replica on Magento

texts:
My Magento DB hosted on AWS MySQL RDS is running at 100% utilization. I have created a Read Replica so that read query can be served by it. But do not know how to configure it.

Does anyone have any idea on how to set up AWS Read Replica for Magento ?


texts: Is it possible to modify Magento 1.9.0.1 so that special price could be set as percentage from the original price? In other words we could set special price to be for example 80% of the original price.


texts:
I'm using magento 2.1.3 and I'm getting the following error when I try to run the php bin/magento indexer:reindex command

  Catalog Search indexer process unknown error:
  There is no such engine: mysql2

Does anyone know how to fix this error?


texts: magento 2 how to call my custom method in test.php at root folder?

texts:
I would like to know, I have a custom method in test.php at magento2 root folder i would like to call my custom method how to do that? i have written a sample test script below please suggest me here thanks.

    <?php
        use Magento\Framework\App\Bootstrap;
        require __DIR__ . '/app/bootstrap.php';
        $bootstrap = Bootstrap::create(BP, $_SERVER);
        $obj = $bootstrap->getObjectManager();
        $state = $obj->get('Magento\Framework\App\State');

        $state->setAreaCode('frontend');
        ini_set('display_errors', 1);

        //Here how to call my custom method ????

        public function getCustomMethod($i)
        {
         echo $i;
         (or)
         return $i;
        }
 ?>


texts: Where to implement the custom button logic?

texts:
I created a button via following code:

<?php

namespace UV\Bestellung\Plugin;

class Buttons
{
public function beforePushButtons(
    \Magento\Backend\Block\Widget\Button\Toolbar\Interceptor $subject,
    \Magento\Framework\View\Element\AbstractBlock $context,
    \Magento\Backend\Block\Widget\Button\ButtonList $buttonList
) {

    $this->_request = $context->getRequest();
    if($this->_request->getFullActionName() == 'sales_order_view'){
        $buttonList->add(
            'bestellschein',
            ['label' => __('Bestellschein'), 'onclick' => 'setLocation(window.location.href)', 'class' => 'reset'],
            -1
        );
    }
}
}

?>

It appears and it is clickable but obviously it has no logic and is doing nothing.
How can I give it a logic and implement it?

Thanks!:-)


texts: Category Paths in Product URLS - Yes or No?

texts:
I've heard some conflicting opinions on whether having category paths in your product URLS is a good idea. An SEO guide I'm currently using suggests that Magento doesn’t support this functionality very well and it creates duplicate content issues.

In your experience, which is should I have this feature turned on or off?


texts: I have two banners that are showing on frontend. I want to show them in a slider. Please suggest something.


texts:
I've written a function that uses debug_backtrace() to find which methods were called in which PHP files to eventually load a given Block. (Look for the blockBacktrace method in the Helper class here.)

What I want to do is reverse engineer the layout to be able to find out which layout XML file declared a given block and defined what block should be it's parent. While it's not a requirement, I would also love to be able to detect blocks which were generated by the CMS and have their XML stored in the database.

Is there a good way available in Magento to reverse engineer the layout to get this information from within a block? My eventual goal is to be able to call a Helper method from within a block which generates output that tells the developer how that block came to be where it is.

Thank you.


texts: Cart becomes empty when cancel the transaction in onestep checkout

texts:
I am working on Depoto.

In this, Cart becomes empty when cancel the payment transaction in one page checkout.
I am using IWD one page checkout. I developed this on Magento-1.9.1.1


texts: Need Advice on Complex Customized Magento 2 Shop

texts:
Products: 900~
Specific Features: 55 to 60
3rd party Extensions required: 20 to 30
Customization required: Theme, Extension, default Magento logic

Could you please advice me based on your experience.

I'm concerned what should be the balance between following(i.e, relative preference, what should be more, what should be less, what should be avoided):

3rd party extensions
customizing theme front end
customizing 3rd party extensions
customizing default magento logic(when not possible via Admin Panel)

Criteria:

performance
compatibiltiy issue
avoiding rework
being able to upgrade Magento + Extensions + Theme.


texts: Magento 2 : Create Product Using REST API

texts:
I'm trying to create simple product using REST API.

Product is created but having issues with Images.

Here is my JSON for it.

{
  "product": {
  "attribute_set_id": 4,
  "type_id": "simple",
  "sku": "B201-SKU",
  "name": "B201",
  "price": 25,
  "status": 1,
  "custom_attributes": {
    "description": "Heavy Duty Brake Cables",
    "meta_description": "Some describing text",
    "image" : "error.png",
    "small_image": "error.png",
    "thumbnail": "error.png"
   }
  }
 }

Note: I've uploaded image under pub/media/catalog/product

When i open products grid at admin, Image is displayed there.
Take a look at below.

Also when i click at grid on Image it showing image is Popup !!!!

  But when i open that product image is not there as well as at
  Frontend.

Also executed upgrade,cache,indexer commands but image is not showing both ends.

What is missing ?? Any one has idea about this ??

Thanks in Advance.


texts: Static version pub/static/versionxxxx increases everytime I load the page

texts:
When I do static:deploy, the version text file is written in pub/static.
When I repeatedly load the website and look at the source, the version number on the link is growing each time.

I checked the processes and nothing is running. It's probably not in a rebuild loop because text file in pub/static stays the same. But the browser request has the version incremented every second. If I wait a bit between the request, like for example 30 seconds, the version will have incremented roughly about 30.


texts:
I've just install Magento on a new website. On backend, when I try to edit / change something on Catalog, CMS, System... anything, and click on Save, it does not save the changes.

How can I fix this?


texts: How to create a product type extends simple product type

texts: I want to create a product with delivery date and number of days custom options by default. for this i need one product type. so please create one product type for me and also i don't know how to create product type in magento. because I'm new to it


texts: How to configured Form Builder Js in my custom magento 2.3.0 module?

texts:
How can I configure below "Form builder js" in Magento 2.3.0 custom extension?

https://github.com/dobtco/formbuilder

I want to use this js in my custom Extension's form in the admin side.


texts: Magento 2 get config values in view/frontend/web/template/payment .html file

texts:
I want to get system config value in frontend template.
Path like "view/frontend/web/template/payment/payment.html"
How it's?
Please help me.
Thanks


texts: Magento2 : Tier price and Tax Calculation

texts:
I am encountering a bug with tier prices displaying and calculating the wrong percentage saved due to taxes.

I am using Australia GST calculations for this: 10% on all products and tax is included in the catalog price entered and price display. Price display is set to show including Tax in most areas except cart where it shows tax breakdown.

I have also setup two tier prices for this test product if the customer orders over a certain amount.

The prices it shows and calculates in the cart and everywhere else are as expected however the saving amount is incorrect.

It seems to be comparing the bulk discount price without tax to the full price with tax.

If I go into the backend and switch the product to have no tax class the saving sections shows the correct values (10% and 25%).

Other Information:

Magento 2.1.2, Custom theme based on Blank,


texts: General error: 1005 Can't create table 'db_name.catalog_category_flat_store_1'

texts:
I am trying to reindex Category Flat Data via ssh with the command php indexer.php --reindex catalog_category_flat but I am getting error as below. I have tried all the solutions posted on the forum but I am not able to fix the issue. Can you look into the error log and let me know if there is any way to fix the issue?

[cpanelusername@server shell]$ php indexer.php --reindex catalog_category_flat
Category Flat Data index process unknown error:
exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1005 Can't create table 'cpanelusername_magento.catalog_category_flat_store_1' (errno: -1)' in /home/cpanelusername/public_html/catalog/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /home/cpanelusername/public_html/catalog/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /home/cpanelusername/public_html/catalog/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /home/cpanelusername/public_html/catalog/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /home/cpanelusername/public_html/catalog/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#4 /home/cpanelusername/public_html/catalog/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('CREATE TABLE `c...', Array)
#5 /home/cpanelusername/public_html/catalog/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('CREATE TABLE `c...', Array)
#6 /home/cpanelusername/public_html/catalog/lib/Varien/Db/Adapter/Pdo/Mysql.php(2039): Varien_Db_Adapter_Pdo_Mysql->query('CREATE TABLE `c...')
#7 /home/cpanelusername/public_html/catalog/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php(604): Varien_Db_Adapter_Pdo_Mysql->createTable(Object(Varien_Db_Ddl_Table))
#8 /home/cpanelusername/public_html/catalog/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php(1418): Mage_Catalog_Model_Resource_Category_Flat->_createTable('1')
#9 /home/cpanelusername/public_html/catalog/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php(1431): Mage_Catalog_Model_Resource_Category_Flat->_createTables()
#10 /home/cpanelusername/public_html/catalog/app/code/core/Mage/Catalog/Model/Category/Indexer/Flat.php(246): Mage_Catalog_Model_Resource_Category_Flat->reindexAll()
#11 /home/cpanelusername/public_html/catalog/app/code/core/Mage/Index/Model/Process.php(209): Mage_Catalog_Model_Category_Indexer_Flat->reindexAll()
#12 /home/cpanelusername/public_html/catalog/app/code/core/Mage/Index/Model/Process.php(255): Mage_Index_Model_Process->reindexAll()
#13 /home/cpanelusername/public_html/catalog/shell/indexer.php(158): Mage_Index_Model_Process->reindexEverything()
#14 /home/cpanelusername/public_html/catalog/shell/indexer.php(198): Mage_Shell_Compiler->run()
#15 {main}

I dont have any DB table called cpanelusername_magento.catalog_category_flat_store_1


texts: I have 500 Internal Server Error in Component Manager

texts:
Magento 2. When I try to open Component Manager I get a 500 Internal Server Error on

/setup/index.php/componentGrid/components

and the page does not load.

I am using php 5.6


texts: creating Configurable products shows products for only one attribute

texts:
I am trying to create a configurable product. I have created 3 attributes and assigned the simple products to each of them. When I want to create a configurable product, if I choose only one of the attributes, the simple products are shown in the "Associated Products".

But if I choose multiple attributes, no products is shown in the "Associated Products" tab. Am I missing something?

Thank you


texts: Clean Magento 2 installation terribly slow

texts:
I did a fresh installation of Magento 2.3.1 (standard theme) and it's terribly slow. The server should be fine because non-optimized M1 installations running good.

I already did the obvious optimizations:

- Minify css enabled
- Minify js enabled
- Minify html enabled
- Merge css enabled
- Merge js enabled
- Bundle js disabled
- Sign Static Files enabled
- Use Flat Catalog

I did not

use Varnish (because I can't cache prices since I will have different prices for different customers).
change mode to production (when I do bin/magento deploy:show:mode I get Magento supports PHP 7.1.3 or later. Please read https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html)

What I noticed is that after I first visited the page, it gets a little bit faster. I guess the pages are cached. But after ~1hr without any interaction it's very slow again.

Is that normal? What could I do? Thanks


texts: Magento non-EAV collections how to group by

texts:
I have this query and I want to add group by main_table.entity_id
        $list = Mage::getModel('sales/order')
        ->getCollection()
        ->join(['SFOI' => $itеm_table], 'SFOI.order_id = main_table.entity_id', ['SFOI.created_at'])
        ->addAttributeToSelect('entity_id')
        ->addFieldToFilter('customer_id', $customer_id)
        ->addFieldToFilter('product_id', $product_id)
        ->getFirstItem()
    ;

I've also try to add ->getSelect()->group('main_table.entity_id') but then ->getFirstItem() didn't work


texts:
I am using Magento1.9 I followed below mention step after that i got error message

UPDATE eav_attribute SET is_required = 0 WHERE attribute_code = 'lastname'

/app/code/local/Mage/customer/Model/Address/Abstract.php:

 /* if (!Zend_Validate::is($this->getLastname(), 'NotEmpty')) {
         $this->addError(Mage::helper('customer')->__('Please enter the last name.'));
     }
*/

/app/code/local/Mage/customer/Model/Customer.php

/*        if (!Zend_Validate::is( trim($this->getLastname()) , 'NotEmpty')) {
        $errors[] = Mage::helper('customer')->__('The last name cannot be empty.');
    }
*/

/app/code/local/Mage/customer/etc/config.xml

<lastname>
                    <billing>1</billing>
                    <shipping>1</shipping>
                    **<required>0</required>** // change from 1 to 0
                    <mapped>1</mapped>
     </lastname>


texts: Magento2 RC - Frontend theme not showing

texts:
I created a theme on Magento 2 1.0.0beta. Now I updated to Magento 2.0.0 RC. After this update, my theme does not show up anymore on the Content > Themes page.

What I did to update my theme

I changed the xsd scheme from lib internal to urn:magento:framework:
I added registration.php

I also tried to add my theme directly to the theme database table. After this my theme does show up. But when I activate the theme I get this error:

Required parameter 'theme_dir' was not passed

Do I have to do something additional to make my theme work? Or do I need to activate it somehow?


texts: How to get REST API RESPONSE in model in Magento2

texts:
Below response parameter is showing in the controller but I want to get this response directly in model. Is there any way to do this?

I want to get paidAmount parameter directly in model.

API RESPONSE PARAMETER

Array
(
    [transactionKey] => 145000094
    [status] => 200
    [exchengeTxId] => 234kjh4h532h3234h
    [remainingAmount] => 1222
    [paidAmount] => 5
)

I want to set [paidAmount] parameter in const FEE_AMOUNT in model:

class Excellence_Fee_Model_Fee extends Varien_Object{

    const FEE_AMOUNT = 5;
    public static function getFee(){
        return self::FEE_AMOUNT;
    }
    public static function canApply($address){

        return true;
        }
    }
}


texts: product image url not valid - magento 2.0.1

texts:
I have created a widget. I am trying to show product image in widget. I have successfully got product name, product url and image url using object manager. But the Image is not loaded (404 - not found).

public function getCollection()
{
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $productCollection = $objectManager->create('Magento\Catalog\Model\ResourceModel\Product\CollectionFactory');
    $collection = $productCollection->create()->setPageSize(1)
        ->addAttributeToSelect('*')
        ->load();

    return $collection;
}

public function getPImage()
{
 $col=$this->getCollection();
 foreach ($col as $product)
 {
    echo $product->getImage();
 }
}

getPImage() method returns string "/m/b/mb01-blue-0.jpg"

I use this string in img src

<img style="height:100%;width:100%;" src="<?php echo $this->getViewFileUrl('images/m/b/mb01-blue-0.jpg'); ?>" />

or without images prefix

<img style="height:100%;width:100%;" src="<?php echo $this->getViewFileUrl('/m/b/mb01-blue-0.jpg'); ?>" />

Yet the image not found, broken image URL path. LumaChange is my custom theme.

http://magentodev.gworks.mobi/magento2/pub/static/frontend/LumaChange/Color/en_US/m/b/mb01-blue-0.jpg

when I found specific product by search store, image url look like below(valid)

http://magentodev.gworks.mobi/magento2/pub/media/catalog/product/cache/1/small_image/240x300/beff4985b56e3afdbeabfc89641a4582/m/b/mb01-blue-0.jpg

Page widget div tag looks like below

Any suggestion to overcome this issue?


texts: Add a variable for current URL to static block/page CMS

texts:
I see that I can insert base url but how can I extend this list to include current URL?

So instead of {{config path="web/secure/base_url"}} something that pulled in the current page URL and I could go from there?  I use the same static block on multiple products and I need this feature.

Thanks for your help!


texts: custom table left join with catalog/product


texts: Magento 2 Override two layout xml for a single module

texts:
How to give 2 different layout xmls within a single module.
My module has one routes.xml with route_id='catalogsearch'

My folder structure:

Vendor\Module\Controller\Result\Index.php     //For CatalogSearch

Vendor\Module\Controller\Category\View.php     //For Catalog

So one of my overridden catalogsearch layout file is:

catalogsearch_result_index.xml

Now I want to override magento catalog module xml.
Magento maintains the route name for catalog as 'catalog' itself.

Now how should I create a separate layout file for my custom module.
Should it be: catalogsearch_category_view.xml?

If I had done like above, even if I search for keyword, in frontpage, I guess toolbar.phtml is calling, instead of catalog search.

My catalogsearch_result_index.xml (which seems to be fine):

<?xml version="1.0"?>
<referenceBlock name="catalogsearch.leftnav">
    <action method="setTemplate">
        <argument name="template" xsi:type="string">Vendor_Module::layer/view.phtml</argument>
    </action>
</referenceBlock>

UPDATED:   My catalog_category_view.xml:

<?xml version="1.0"?>
<referenceBlock name="product_list_toolbar">
    <action method="setTemplate">
        <argument name="template" xsi:type="string">Vendor_Module::product/list/toolbar.phtml</argument>
    </action>
</referenceBlock>

routes.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route id="catalogsearch" frontName="catalogsearch">
            <module name="Vendor_Module"/>
        </route>
    </router>
</config>

UPDATED:


texts: Magento 1.9 store integration with Click & Drop

texts:
my magento 1.9 store is integrated with royal mail click & drop. i am successfully create Soap/XMLRPC - User and Role with UserName and API key.
i am providing this UserName and API Key to Click & Drop settings.
but when i click the update connection in click & drop settings it will shows "Connection to your marketplace failed. Please check your details and try again".
please any one help me solve this issue. is any log file shows the actual error information.


texts:
We have all the email address set in System -> Config -> Store Email Addresses.

However, the emails are being sent from the mail server.

Is there another setting that I am missing for send from Email address?


texts: How can I change menu font with custom font?

texts:
How can I change menu font with a custom font?
The font is already installed in my child theme and I can use it on home page with

<style>font-family: 'BPG Arial Caps'; </style>

But how can I use it , parent theme is sm bestshop


texts:
I am having a issue on my live server, when I try to login to the admin panel it lets me through but then it just hangs and the panel never gets loaded.
The same code running on my dev instance works fine so I am guessing it is not a code issue.

Any thoughts?


texts: Impossible to change Bundle item order from one page to another

texts:
i have a bundle product with more 50+ bundle items, however, doing this creates multiple pages with 20 items in each page, my issue is changing items order where if an item is in page 3 for example, i can't move it to page 2 or page 1.

Is there any solution or workaround ?


texts: How do I create groups of accessories that I can assign to simple products? Magento Community

texts: On our site, we have many products that will use the same "set" of accessories to display as upsell items on front end, so I am looking for a convenient way to assign accessories to the products without having to do them one by one for each and every product. We upload 100's of new products daily and would prefer to create accessory "groups" that we can assign. My current developers say this is not possible in Magento but I have a hard time believing that. I am not a developer myself, so I am reaching out to the community to try and find a solution I can pass along to my team, or possibly understand myself. Any help is greatly appreciated!


texts: Adding a link to comparison page in Add-to-compare confirmation

texts:
Is it possible to add a link to the comparison page from within the confirmation that an item has been added to the compare list?

The addAction() function in app/code/core/Mage/Catalog/controllers/Product/CompareController.php is where the success message is generated. I tried adding some code in there to create the link to the compare page but I got a fatal error.


texts: Cron stops running and I have to restart using SSH

texts:
Magento ver. 1.9.3.8

In my Cpanel I have 2 cron jobs set to run */5 *   *   *   *.

/usr/local/bin/ea-php56 /home/myusername/public_html/cron.php -mdefault >/home/myusername/public_html/var/log/myjob1.log

/usr/local/bin/ea-php56 /home/myusername/public_html/cron.php -malways >/home/myusername/public_html/var/log/myjob.log

If I just create the cron jobs in Cpanel nothing happen. I then have to run the same commands using SSH. Only then do they start.

For some reason, my cron jobs turn off around 00:00 but not every night.  Sometimes it goes 2-3 days working. Once it turns off, it turns off around the same time and I have to repeat the SSH steps.

The first time I noticed it was 1.9.3.7. Since then I have been trying to trouble shoot.

Any help with this would be greatly appreciated.


texts: Magento 1/theme or NGinx fault? 404 on some theme feature settings

texts:
We've got Magento 1.9.4.4 on nginx/1.14.2 and PHP v7.3.14 and we're using EM Titany (free) theme.
I've just moved the shop from an old server to a new one (PHP5 to PHP7) and things have been working on PHP5.

The theme comes with plenty of settings and a visual content editor.
The settings are all working fine in the default admin area/style.
The content editor only yields a 404 page without any exceptions being printed in nginx log and exception log.

I'm not sure where to start debugging. Usually issues like these might come from Nginx config but should then show something in the error log when it's a 404? (I can only see 200 entries in the access log when loading the 404 page).
Or might it be from the theme which could be PHP7 incompatible (couldn't find any info on the EM website)?


texts: Programmatically import products and set custom attribute value

texts:
I'm importing my products from a .csv and I have some trouble setting the custom attribute values. The attribute types are dropdown since they are used for configurable products.

error_reporting(E_ALL);

include_once "../app/Mage.php";
include_once "../downloader/Maged/Controller.php";

Mage::init();

// Set the store id
$app = Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$Simpleproduct = Mage::getModel('catalog/product');

try{
    $Simpleproduct
    ->setWebsiteIds(array(1))
    ->setAttributeSetId(4)
    ->setTypeId('simple')
    ->setCreatedAt(strtotime('now'))
    ->setSku('testsku61') //SKU
    ->setName('test product21')
    ->setWeight(4.0000)
    ->setPrice(11.22) //price in form 11.22
    ->setDescription('This is a long description')
    ->setShortDescription('This is a short description')
    ->setStockData(array(
        'use_config_manage_stock' => 0,
        'manage_stock'=>1,
        'min_sale_qty'=>1, //Minimum Qty Allowed in Shopping Cart
        'max_sale_qty'=>2, //Maximum Qty Allowed in Shopping Cart
        'is_in_stock' => 1, //Stock Availability
        'qty' => 999 //qty
         )
     )
    ->setCategoryIds(array(3, 11))
     $data=array(
       'afmeting' => '180 x 100',
       'afwerkingblad '=> 'Havanna',
       'afwerkingonderstel '=> 'Blank');

//Mage::getSingleton('catalog/product_action')->updateAttributes(array($Simpleproduct->getId()), $data, $storeId); // Found out this is only for updating
  $Simpleproduct->setData($data); // this doesn't work either
  if($Simpleproduct->save()){
    echo "test";
  }
  }catch(Exception $e){
    Mage::log($e->getMessage());
    echo $e;
    echo "faal";
  }

Whenever I run the code I get the following error:

exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`db90927_magento`.`catalog_product_entity`, CONSTRAINT `FK_CAT_PRD_ENTT_ATTR_SET_ID_EAV_ATTR_SET_ATTR_SET_ID` FOREIGN KEY (`attribute_set_id`) REFERENCES `eav_attribute_set` (`attribute_set_id)'


texts: Magento 2 Remove Items From Cart With Qty = 0

texts:
In Magento 1.9, when we added multiple products into the cart, we can removing them by entering 0 in the Quantity field for each product, and then click on Update Basket button, then those products with 0 in quantity fields will be removed from the shopping cart.

But it seems this feature has been removed in Magento 2. It's not allowed to enter a 0 in the Qty field any more. Can we turn this feature on?


texts: How to create Magento Config Yesno in custom phtml template in magento 2?

texts:
I want to create magento default Yesno option in custom phtml template.This can be created in system.xml by using this code.

<field id="testID" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
       <label>Custom Select Option</label>
       <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>

But how this can be created in my custom phtml template.


texts:
For my custom module i need to add one top-menu to homepage. Path may change according to the value given in configuration section.
How can i add dynamic link to the top-menu item.Please help


texts: Coupon code for free product with purchase over $99

texts:
I want to create a coupon code to have a specific product added to the cart at no cost when the order total is over $99 and the code has been entered.

I am not having any luck figuring out how to make this happen. Any advise would be greatly appreciated.


texts: How to get customer shopping cart information using sql query

texts:
How to get customer shopping cart information using custom sql query.

I want to get shopping cart product information like below.

for example ::

  product_name,
                 product_id,
                 product_image,
                 qty,
                 row_total,
                 is_in_stock,
                 base_subtotal,
                 base_grand_total,
                 shipping_amount,
                 street


texts: Splitting order payment into several transactions

texts:
What would be the proper way to approach splitting order payment amount to a several payment transactions? For example to split order of $300 and make several payment gateway API calls billing customer for 100, 100 and 100.

Is it even possible to have one Order with multiple transactions of Authorize/Capture type and have them voided/refunded later on?


texts: Magento2 - How to display custom attributes on Product Details page near product name

texts:
How to display custom attributes on Product Details page near product name?.
Here Manufacturer Name and Manufacturer Number is custom attributes. which value i want to show on Product Details page near product name.

Using this code view/frontend/layout/catalog_product_view.xml
<?xml version="1.0" encoding="UTF-8"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceBlock name="product.info.details">
        <block class="Magento\Catalog\Block\Product\View\Description" name="product.info.demo" template="Custom_ProductAttribute::product/view/attribute.phtml" after="-">
            <arguments>
                <argument name="at_call" xsi:type="string">getDemoLink</argument>
                <argument name="at_code" xsi:type="string">manufacturer_name</argument>
                <argument name="css_class" xsi:type="string">manufacturer_name</argument>
                <argument name="at_label" xsi:type="string">Manufacturer Name</argument>
                <argument name="add_attribute" xsi:type="string">itemprop="manufacturer_name"</argument>
            </arguments>
        </block>
    </referenceBlock>
</body>

view/frontend/templates/product/view/attribute.phtml
<?php

 $manufacturerName = $_product->getResource()->getAttribute('manufacturer_name');
echo $manufacturerName->getFrontend()->getValue($_product);

?>


texts: Magento 1.9.3.1 Uncaught Error: Class 'Magento_Db_Adapter_Pdo_Mysql' not found

texts:
I am getting error frontend and backend both side

Fatal error:

Uncaught Error: Class 'Magento_Db_Adapter_Pdo_Mysql' not found in /app/code/core/Mage/Core/Model/Resource.php:175
Stack trace:
#0 /app/code/core/Mage/Core/Model/Resource.php(110): Mage_Core_Model_Resource->_newConnection('pdo_mysql', Array)
#1 /app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(320): Mage_Core_Model_Resource->getConnection('core_write')
#2 /app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(350): Mage_Core_Model_Resource_Db_Abstract->_getConnection('write')
#3 /app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(335): Mage_Core_Model_Resource_Db_Abstract->_getWriteAdapter()
#4 /app/code/core/Mage/Core/Model/Resource.php on line 175

How can I fix the issue?


texts: Magento 2 Product quantity showing empty on Update Product details page

texts:
Step to reproduce

Add product to cart
Go to cart page
Click on Edit item parameter.

Qty box value empty.

Any help would be appreciated!Thanks.


texts:
I am running Magento 2.1.7 and Paypal Pro 2.0. From what I understand from the people at Paypal, Magento 2 runs a $0.00 transaction before it processes the actual payment; apparently, that is proper functionality for Magento 2. I know, it is weird, but I suppose there is a reason. Not a problem, except that PayPal charges me $0.30 for each of these false transactions.

The people at PayPal said that the Magento shopping cart should be modified to add a prefix to the invoice, and that will solve the problem.

Does anyone know anything about this?


texts: Magento2: How to set minumum order price for specyfic group

texts:
I see Magento provide possible set minimum order qty. For specific group. But how to set minimum order price for specific group?

I see is available option only set for all groups minimum order price in store.

But how to set example:

Group I: wholesale: min order price 200$
Group II: Dropshipping partners: no minimum order price


texts: I want to know that which paypal methods provided by Magento are Onsite and which are offsite.


texts:
I require 2 options for shipping to be set in magento 2.18.

First option is Home delivery @ £1
Second Option is using a delivery company by weight

is this possible?


texts: Magento 2 (v2.1.2) - Choosing separate theme for product page

texts:
I am currently trying to setup an individual custom theme specifically for some products. I have another custom theme which will style/structure the rest of the site along with its own product page styling. However, this doesn't seem to work. It still uses the structure from the "master theme" and only takes the styles/assets from the selected alternate custom theme chosen inside the products admin in Schedule Design Update.

Here is the structure for the "master" theme which structures everything BUT the products that get told otherwise.

This theme is working as expected and, whilst testing I dropped in the XML file to this theme which structures the rest of the site, it creates the expected layout.
Here is the structure for the "alternate" product theme, which the XML doesn't seem to get recognised at all, no matter which XML file inside Magento_Theme > layout.

Can anyone spot a problem in how both themes have been setup? The "alternate" theme is not a child of the master theme, however this has been tried too.

Thanks in advance!


texts: Setting X-Magento Tags for custom controller

texts:
I have a custom controller for infinite scroll and filtered attributes which simply returns a json response. When modifying a category or product these cached responses are not cleared however.

Looking at the varnish headers the below header is missing for my responses:

X-Magento-Tags: store,cms_b,cat_c,cat_c_79,cat_c_109,cat_c_143,cat_c_182,cat_c_702,cat_c_257,cat_c_304,cat_c_342,cat_c_521,cat_c_533,cms_b_print_header,cms_b_usp,cms_b_social_links,cms_b_payment_methods,cat_c_202,cat_c_p_202,cat_p_17803,cat_p,cat_p_10755

I believe these are how Magento knows to purge from Varnish cache when modifications are made to any of above however am not sure how to make sure these are set within my controller?

There seems to be 2 files I can currently identify that seem to modify this header:

Magento\PageCache\Model\Controller\Result\BuiltinPlugin
Magento\PageCache\Model\Layout\LayoutPlugin

The layoutplugin class seems to just be related to blocks currently on page to add tags however neither seems to be present in response.

I can set the tags like below:

$result->setHeader('X-Magento-Tags', implode(',', $tags));

However need to know an easy way of getting the appropriate tags if possible for that category and products present on that page or how to just get the default method of setting these to kick into action here.


texts: How to find the layout for the Home page

texts:
I'm working on a Magento 2.2.9 website that somebody has already built before me. I'm trying to change the layout for the Home page and I'm really confused about which file I should be editing. I've found that the layout will be either in default.xml or in cms_index_index.xml.

Here is the location of my default.xml:

/home/folder/site.com/html/app/design/frontend/Infortis/ultimo/Infortis_Ultimo/layout/default.xml

Here is the content of the file:

<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceBlock name="head.additional">
        <block class="Infortis\Cgen\Block\AssetWrapper\Combined" name="head.additional.asset-wrapper" template="assets/wrapper/combined.phtml">
            <arguments>
                <argument name="asset_name" xsi:type="string">cfg.css</argument>
                <argument name="asset_id" xsi:type="string">iult</argument>
            </arguments>
        </block>
    </referenceBlock>
</body>

Here is the location of my cms_index_index:

/home/a2b89dbe/westhort.com/html/vendor/magento/module-cms/view/frontend/layout/cms_index_index

Here is the content of my cms_index_index:

<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body/>
</page>

So, my guess is that the Home page configuration is in file urn:magento:framework:View/Layout/etc/page_configuration.xsd but I couldn't find it. Does anybody know where this file can be? Is there any other way to know how my Home page is configured?


texts: Conditional loading headline based on category id magento for product page

texts:
For SEO reason I would like to display both the name of the parent category and the sub-category in the headline of a catalog page, but only in some cases.
I don't want to use it in the original parent categories because it then will display "default category" in front of the category name, so it would display "Default category Ralph Lauren".

If the category ID is 2, 3, 4, 5, 6, 7 and 43 i would like to echo;

    <?php if($this->IsRssCatalogEnable() && $this->IsTopCategory()): ?>
        <a href="<?php echo $this->getRssLink() ?>" class="link-rss"><?php echo $this->__('Subscribe to RSS Feed') ?>
    <?php endif; ?>

 <?php $parentname = $this->getCurrentCategory()->getParentCategory()->getName(); echo $parentname; ?>
<?php echo $_helper->categoryAttribute($_category, $_category->getName(), 'name') ?>

But on any other category page I would like to echo;

    <?php if($this->IsRssCatalogEnable() && $this->IsTopCategory()): ?>
        <a href="<?php echo $this->getRssLink() ?>" class="link-rss"><?php echo $this->__('Subscribe to RSS Feed') ?>
    <?php endif; ?>

<?php echo $_helper->categoryAttribute($_category, $_category->getName(), 'name') ?>

I've tried using the following snippet on one of the categories, but it just display two headings;

<?php if (Mage::registry('current_category') == 2): ?>
// display content for category with the ID 2
<?php else: ?>
// content for other categories
<?php endif; ?>


texts: Does magento 2 support PayPal IPN? I cannot find any document mentioned about it.


texts:
i want to create class construct function in this model this is payment model  PaymentMethod extends \Magento\Payment\Model\Method\AbstractMethod i try but getting an error what wrong I am doing.

use Magento\Framework\DataObject;
use Magento\Payment\Model\InfoInterface;
use Magento\Payment\Model\MethodInterface;
use Magento\Payment\Observer\AbstractDataAssignObserver;
use Magento\Quote\Api\Data\PaymentMethodInterface;
use Magento\Sales\Model\Order\Payment;
use Cryozonic\StripePayments\Helper\Logger;

  public function __construct(
        \Magento\Framework\Model\Context $context,
        \Magento\Framework\Registry $registry,
        \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory,
        \Magento\Framework\Api\AttributeValueFactory $customAttributeFactory,
        \Magento\Payment\Helper\Data $paymentData,
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
        \Magento\Payment\Model\Method\Logger $logger,
        \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
        \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
        array $data = []
    ) {
        parent::__construct(
            $context,
            $registry,
            $extensionFactory,
            $customAttributeFactory,
            $resource,
            $resourceCollection,
            $data
        );
        $this->_paymentData = $paymentData;
        $this->_scopeConfig = $scopeConfig;
        $this->logger = $logger;
        $this->initializeData($data);
    }


texts: Some Ipad 2 users cannot add products to the cart,how to debug?

texts:
We have a magento site, running on Magento 1.8.0.

We get complaints from some of our customers because they can't add a product the cart.
They always have an Ipad 2. But not all ipad 2 users have this problem (so maybe a certain OS version?). Iphone and other Apple products work just fine with our website.

We don't have errors in our log, and we've tried everything with cookies (set cookie path, set cookie lifetime to 86400, even remove the cookie part in Varien.php). Nothing seems to solve the problem.

How can I reproduce this bug so I can solve it? I have to do this without the Ipad 2 as I don't own one.

Maybe someone has experience with this Ipad 2 related-bug?
It's in Safari and Chrome on the Ipad 2, so it's not an safari problem


texts:
My mini cart doesn't refresh when you try to add quantity or remove product, I have been told it needs a form key but I'm not sure what file needs to be altered the error is below:

:5:{i:0;s:16:"Invalid form key";i:1;s:893:"#0 /home/posiecou/public_html/app/code/core/Mage/Checkout/controllers/CartController.php(604): Mage::throwException('Invalid form ke...')
#1 /home/posiecou/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Checkout_CartController->ajaxDeleteAction()
#2 /home/posiecou/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('ajaxDelete')
#3 /home/posiecou/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#4 /home/posiecou/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#5 /home/posiecou/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#6 /home/posiecou/public_html/index.php(90): Mage::run('', 'store')
#7 {main}";s:3:"url";s:91:"/checkout/cart/ajaxDelete/id/812/uenc/aHR0cDovL3d3dy5wb3NpZS5jby51ay9idXR0b25ob2xlcy5odG1s/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";


texts: How can I create a drop down menu for CMS pages in Magento

texts:
I would like to create a simple dropdown menu for CMS pages as there are main pages and then sub pages

For example I have

ABOUT US

sub category item

BIKE FITTING

Road Bike fitting
Mountain Bike fitting

SERVICING

Kind of service 1
Kind of service 2

etc

These are all CMS pages and I've created a sub category level in category management - I am new to Magento...so please excuse me if this is ridiculous

<?php $_menu = $this->getHtml('level-top') ?>

<?php if($_menu): ?>
    <nav id="nav">
        <ol class="nav-primary">
            <?php echo $_menu ?>
        </ol>
    </nav>
<?php endif ?>


texts: Copy cms page and create many for different stores

texts: Requirements: I have to display same CMS page for different site so I have to create copies of 1 cms pages to display for other store-views. Is there any method to copy 1 cms page like we can do copy product to create duplicate products?


texts: Can't login admin panel 1.9.2 after clean var/session

texts:
I worked hard at my website (mag community), but now i can't login in the admin panel.
I want to know if there is a simple solution to solve this problem.
After i deleted all session from var/session, it works once, but now i have the same problem.

Please, any advices ?
Thanks,
silver


texts: In the payment controller, how do I get the quote/order ID that the user checked out?

texts:
The payment method I have uses a third party gateway. I need to forward the Increment Order ID to them.

public function getOrderPlaceRedirectUrl() {
    return Mage::getUrl('shopping/checkout/forwardweb', array('_secure' => true));
}

What I would like to do is to get the order and send the $order->getIncrementId().

I tried using $orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();

But for some reason, it's always returning the same order id, no matter how many times I check out my cart, and if I go to the website, and list the orders, the new orders are not being added to the list, and it's always empty.


texts:
I'm using Magento 2 and would like to know where the log files are for mysql. Are they inside my main magento folder or are they elsewhere. I know that the main log files for magento are in var/log but I cannot seem to find the mysql errors. ]

Reason I'm looking is to solve:

>[2018-09-17 20:59:51] main.ERROR: MySQL connection failed: SQLSTATE[HY000] [2002] No such file or directory [] []


texts: Setting up parent attribute for catalog filters

texts:
I am currently working on a Magento site (v.1.9) that has 70 different product colors. This means that on the product index page, there is a massive list of colors for users to filter by on the left-hand column. We are worried that this is too many options for people to sift through.

Our colors are very specific, and realistically they could be grouped into "parent" colors. For example, we have "blush," "light pink," "salmon," etc, but those could all sit under the color "pink" for filtering purposes. Within the product detail page, however, we would want the actual color name to appear in the product color dropdown. Is there a way to create these parent color filters to appear in the left-hand column on the index pages?

I'm not a developer so layman's terms would be greatly appreciated!


texts: How can I get a list of orders greater than a specific order number in VB.Net?

texts:
I'm really struggling with this.  Situation:

I am trying to import a list of orders from a Magento site.  I only want orders with an increment_id greater than 800009, for example.

Using filters like this:

Private Function GetOrderList(startOrderNo As String)

    Dim ae As New GrendeneWebService.associativeEntity
    Dim params As New GrendeneWebService.filters
    ae.key = "increment_id"
    ae.value = startOrderNo

    params.filter = New GrendeneWebService.associativeEntity() {ae}

    Dim orderListEntity = New GrendeneWebService.salesOrderListEntity()
    Dim orderListResponse = New GrendeneWebService.salesOrderListResponse
    Dim orderlistRequest = New GrendeneWebService.salesOrderListRequest(sessionID, params)

    Dim orderList()

    orderListResponse = mage.salesOrderList(orderlistRequest)

    orderList = orderListResponse.result

    Return orderList

End Function

I can get the order number that I pass to the function, but I want every order with a number GREATER THAN OR EQUAL to the order number passed.

Any help would be really appreciated.

Thanks


texts: Unable to list current working directory

texts: I am unable to upload product images for clothing and jewelry attributes


texts: default Vs production deployment mode in Magento 2

texts:
I know the difference between developer and production deployment mode.

I looked at various posts as well as Magento DevDocs though cannot figure out the main differences between default and production mode.

So, in what way default and production mode differ from each other?


texts:
I try to fetch all products in bunches from the REST API in Magento 2.3.1:

GET http://example.local/rest/V1/products?searchCriteria[page_size]=100&searchCriteria[sortOrders][0][field]=updated_at&searchCriteria[sortOrders][0][direction]=ASC&searchCriteria[currentPage]=88000
Content-Type: application/json
Authorization: Bearer mybearer

I have 250 Products in the shop, still this request returns results. Shouldn't such a ridiculously high page number return an error or no results?


texts: Getting http code 400 on Magento REST API call where token has 'admin' & 'all' privileges

texts:
I'm trying to create a customer using the Magento REST API.

I can use my token to retrieve/update data just fine, but for whatever reason I am unable to create an account, regardless of the permissions I set ("All" or "Custom with checked boxes").

Here is a screenshot of the Magento admin, if you notice, for whatever reason, Customers does not have a Create option and I cannot figure out why that is either, and may ultimately be why I am unable to use the POST /api/rest/customers call as outlined in the Magento documentation.

Any advice would be greatly appreciated. Thank you!


texts:
In developer mode I been getting the error

FileError: '/pub/static/frontend/theme/theme_name/en_GB/css/styles-m.css' wasn't found (404)

I've taken the following steps to try and resolve this:

Used Refresh static content in the cache management

Taken magento2 out of development mode, check if worked then back in development mode

Backup current static folder, removed contents inside and try to refresh.

All of these points still give me the error above


texts: redirection from payment gateway to website make empty cart

texts:
We are using Paytm extension in our client's website https://www.safaribags.com which builds on Magento 2.1

When customers click on "Pay with Paytm" button, the customer redirects to the Paytm Pay URL. On the Paytm Pay URL, browser's back button is enabled, so when they click on that button, they redirect to the website but their cart would be empty every time.

So I want to know some solution for this issue.

This issue is in the live website, so please support ASAP.


texts: Magento 2.3.4: Is there an alternative tag to "area" to meet AMP requirements for my store home page

texts:
Google Search Console identified the tag "area" in the HTML of our Magento store home page. The HTML is as seen below. Is there an alternative to this tag so as to fix the Accelerated Mobile Pages error search console pointed out?
<area title="TV Mirrors" alt="TV Mirrors" coords="1011,740,1262,785" shape="rect" href="/mirrors/tv-mirrors.html" target="_self">

<area title="Vanity Mirrors (lighted)" alt="Vanity Mirrors (lighted)" coords="250,86,555,139" shape="rect" href="/mirrors/lighted-vanity-mirrors.html" target="_self">

<area title="Backlit Mirrors" alt="Backlit Mirrors" coords="245,28,562,72" shape="rect" href="/mirrors/backlit-mirrors-category.html" target="_self">

<area alt="" coords="244,29,245,72" shape="rect">


texts: How to retrieve variable from CMS page in Magento 2

texts:
In Magento 1.9.x, we can do it like below

In CMS page, add content:

{{block type="core/template" name="..." my_vars="123,456" template="path-to/test.phtml"}}

Create path-to/test.phtml:

<?php echo $this->getData('my_vars'); ?>

My question is: how to achieve it in Magento 2?

Hope somebody could say more detail.


texts: How to Import Products, Categories and Custom Attributes from database?

texts:
As the question says.

I want to import products, categories and custom attributes on database level. What tables do I need to take with me?

For the curious among you:

The reason is that I had a server that has been corrupted that used to host my website. Now all what I'm left with is a .sql file from a backup that contains all my products data.
I also have an export of products from Magento admin in a .csv file. But I realized the hard way that Magento 2 default import/export is a total crap.


texts: Magento 2: Unable to resize the swatch image

texts:
view.xml:

        <image id="swatch_image_base" type="swatch_image">
            <width>500</width>
            <height>600</height>
        </image>

         <image id="swatch_image" type="swatch_image">
            <width>500</width>
            <height>600</height>
        </image>
        <image id="swatch_thumb" type="swatch_thumb">
            <width>500</width>
            <height>600</height>
        </image>
        <image id="swatch_thumb_base" type="swatch_thumb">
            <width>500</width>
            <height>600</height>
        </image>

Swatch image is not resizing,it update the size of product image of size 213 x 300 when clicked on any configurable color swatches.

The output:

<img class="product-image-photo" src=" 213 x 300 size of image path " max-width="500" max-height="600" >

Please help me,if something missed here on view.xml file or any other way to do so.

Note: Done the cache clear, flushed the images, even deployed the static content.


texts: No payment module is displayed First Data Payeezy

texts:
I installed this module:

http://www.magentocommerce.com/magento-connect/first-data-payeezy-with-transarmor.html

I have correctly configured the field, but this method of payment is the only one to use is not displayed when I pay. There is no error and the system.log shows nothing. This also installed an SSL.


texts: Getting id from wishlist product remove link

texts:
I read this Remove from wishlist URL? but I have a problem with.

I'm trying to find $removeID in this link: xx.com/wishlist/index/remove/item/$removeID/

Because wishlist remove url almost same. Only difference is $removeID


texts: How to set 3d Secure on Magento ? (Err: Centinel API endpoint URL is not configured properly.)

texts:
I have an issue with 3d Secure and Authorize.net on Magento (1.7.02):

Error say:
Centinel API endpoint URL is not configured properly

After some investigation I found out that in the backend you can set value in
-> Payments Services-> 3D Secure Credit Card Validation.

I really don't know what data should I set here ID for what ?

I also see that in Payment Methods -> Authorize.net there is 3d secure box with Centinel API URL should I set this for any reason ? and what value ?


texts: Some products images doesn't show up because the URL is uppercase

texts:
Since I've migrated Magento 1.7 to 1.9 some images doesn't show up. I found that the ones who doesn't show up are those with uppercase letters in url and when I manually insert lowercase letters, the image show up.

What can I do?

Thank you very much.


texts:
What I wanna do is to update the field comment_author and change the type from tinytext to varchar(100)

For some reason it complains about "Invaild default value for 'comment_date'"

Why does it complain when I'm not even trying to change it?
The command I'm using is:

 `mysql> Alter TABLE `wp_comments` MODIFY COLUMN `comment_author` VARCHAR(100);`

Thanks!


texts:
In my CE-1.9.0 store my products currently create the following url rewrites:

http://example.com/product-name
http://example.com/category/product-name
http://example.com/another-category/subcategory/product-name

However in my store I want to be able to stop creating the rewrites for the category versions. I have System > Configuration > Catalog > Catalog > Use Categories Path for Product URLs set to No so these extra rewrites are unnecessary. Plus my store has around 500,000 products and counting so these extra url's are taking up a lot of space in the core_url_rewrite` table.

So my aim is to only be left with these versions:

http://example.com/product-name

If I truncate the core_url_rewrite table and reindex then only these versions get created so it is only when new products are created. My catalog is so large so I cannot keep truncated and rebuilding the table from scratch as the rebuilding takes several hours.

With help from this question I have found the file that is responsible for creating the rewrites when a product is created. It is:

app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php

However the answer is no longer valid as the code has changed in the core file.

In this file on line #538 there is the _afterLoad function it is the line

$this->_addUrlRewrite($this->_urlRewriteCategory);

And this function _addUrlRewrite however i've tried changing a lot inside this function but have had no luck. The function in full is:

protected function _addUrlRewrite()
{
    $urlRewrites = null;
    if ($this->_cacheConf) {
        if (!($urlRewrites = Mage::app()->loadCache($this->_cacheConf['prefix'] . 'urlrewrite'))) {
            $urlRewrites = null;
        } else {
            $urlRewrites = unserialize($urlRewrites);
        }
    }

    if (!$urlRewrites) {
        $productIds = array();
        foreach($this->getItems() as $item) {
            $productIds[] = $item->getEntityId();
        }
        if (!count($productIds)) {
            return;
        }

        $select = $this->_factory->getProductUrlRewriteHelper()
            ->getTableSelect($productIds, $this->_urlRewriteCategory, Mage::app()->getStore()->getId());

        $urlRewrites = array();
        foreach ($this->getConnection()->fetchAll($select) as $row) {
            if (!isset($urlRewrites[$row['product_id']])) {
                $urlRewrites[$row['product_id']] = $row['request_path'];
            }
        }

        if ($this->_cacheConf) {
            Mage::app()->saveCache(
                serialize($urlRewrites),
                $this->_cacheConf['prefix'] . 'urlrewrite',
                array_merge($this->_cacheConf['tags'], array(Mage_Catalog_Model_Product_Url::CACHE_TAG)),
                $this->_cacheLifetime
            );
        }
    }

    foreach($this->getItems() as $item) {
        if (empty($this->_urlRewriteCategory)) {
            $item->setDoNotUseCategoryId(true);
        }
        if (isset($urlRewrites[$item->getEntityId()])) {
            $item->setData('request_path', $urlRewrites[$item->getEntityId()]);
        } else {
            $item->setData('request_path', false);
        }
    }
}


texts: Get Customer information inside Admin Panel

texts:
I created a custom tab in the Admin Panel under
Customers -> Manage Customers -> My Custom Tab
At this point how can I get information about the customer I'm looking at, not the Admin User logged in.

The only tricky way I see is using getUrl and parsing through the url since the ID is in there but is there an easier way?


texts: Magento2 how to get the payment method title instead of payment html in new order transaction email?

texts: How to get the payment method title instead of payment html raw in order transaction email in magento2


texts: Break Tags in Product's Short Description

texts:
Cant get the text in "Short Description" to align.

There is break tags being added to my product's short description on the front end product detail page that are not found in the short description when I review the product from the admin.

Any help is appreciated.


texts: Magento2 Product Price For Widget is not refresh price with currency switcher

texts:
I have create one widget and display some products to that product,
but while change currency using currency switcher , it does not change new currency


texts: Error while creating products through API

texts:
Next exception 'Exception' with message 'Report ID: webapi-5f21134ddaf98; Message: Property "CategoryLinks" does not have corresponding setter in class "Magento\Catalog\Api\Data\ProductExtensionInterface".' in C:\XAMPP\htdocs\demowebsite\vendor\magento\framework\Webapi\ErrorProcessor.php:196
But there is nothing as "CategoryLink" in ErrorProcessor.php


texts:
I am trying fix bug with Add to cart. I have 3 stores - Production, QA and local versions.

When I press add to cart from list or product pages it load empty cart. If I try add the same product second time, it show me shopping cart with this product. This bug only on Production and QA versions, but this is no error on my local PC. Also I deployed this store on my hosting. And there is no bug too.

I think problem with hosting where located Production and QA stores.
Have You any ideas or experience with this bug? Thanks.

Store


texts: Event before save order or place order in magento 1.9.1.1

texts:
Get event before place order or save new order. I have tried the sales_order_save_before event but I didn't get any data. Below is my code,
In config.xml:

<sales_order_save_before>
    <observers>
        <custom_observerwww>
            <type>singleton</type>
            <class>Custom_Module_Model_Observer</class>
            <method>removeItems</method>
        </custom_observerwww>
    </observers>
</sales_order_save_before>

In Observer.php:

class Custom_Module_Model_Observer {
    public function removeItems($observer){
        Mage::log($observer->getEvent()->getOrder(),null,"order.log",true);
    }

There is no data received in log file.


texts: Want to run MAgento 2.0 only in Thai language

texts: I want to run a magento site only in the Thai language and not in english for SEO optimization. Is that possible for do i have run it in English also?


texts: How to release the new version of extension to market store?

texts:
I have a plugin with already 'Released to Store' with version 1.0.0.

Recently, I have submit a new version for this extension (version 1.0.2) and it already passed marketing preview. However the status of new version is still 'Approved' instead of 'Released to Store'.

So, how can I release the new version to store after passed the marketing review ?

Many thanks.


texts: which observer to call while removing item from cart and empty cart in magento 2?

texts: Is there an observer which can be used to observe events when a product is removed from the cart? I haven't found any.


texts: multiple AND & OR conditions in collection

texts:
I have a statement that would be really easy to write out (see below) but I can't seem to figure it out for Magento. The statement is:

SELECT * FROM addresses
WHERE
    $postcode_from BETWEEN (pc_from AND pc_to)
    OR $postcode_to BETWEEN (pc_from AND pc_to)
    OR (
        $postcode_from <= pc_from
        AND $postcode_to >= pc_to
    )

Is this going to be possible or am I going to have to write out the statement and manually feed it to Magento?

EDIT*

Here's what I've got currently. It works but is messy:

$select = $read->select()->from($table);
$select->where(
    $read->quoteInto(" ( ? >= postcode_from", $upload['postcode_from']) .
    $read->quoteInto(" AND ? <= postcode_to )", $upload['postcode_from']) .
    $read->quoteInto(" OR ( ? >= postcode_from ", $upload['postcode_to']) .
    $read->quoteInto(" AND ? <= postcode_to )", $upload['postcode_to']) .
    $read->quoteInto(" OR ( ? <= postcode_from ", $upload['postcode_from']) .
    $read->quoteInto(" AND ? >= postcode_to )", $upload['postcode_to'])
);

$selection = $read->fetchAll($select);

EDIT

For anyone confused as to what I am trying to achieve:

I have pc_from_1 and pc_to_1. these are stored in the database.

I also have pc_from_2 and pc_to_2. These are from user input.

I want to check if any of the following occurs:

// Where this
      pc_from_1           pc_to_1
         |-------------------|
pc_from_2       pc_to_2
   |--------------|

//or this
      pc_from_1           pc_to_1
         |-------------------|
                 pc_from_2            pc_to_2
                    |--------------------|

// Or this
      pc_from_1           pc_to_1
         |-------------------|
pc_from_2                         pc_to_2
   |---------------------------------|
// occurs


texts: Magento 2: Property "ActionsHintLabel" does not have accessor method "getActionsHintLabel" in class "Magento\SalesRule\Api\Data\RuleInterface"

texts:
In Magento 2 I am trying to add SalesRule from API: /rest/V1/SalesRules
Post Request body:

{
    "rule": {
    "name": "Test SalesRule",
    "store_labels": [],
    "description": "test 50% discount",
            "website_ids": [
                1
            ],
            "customer_group_ids": [
                1,
                2,
                3,
                5,
                6
            ],
            "from_date": "2019-02-26",
            "to_date": "2019-03-05",
            "uses_per_customer": 1,
            "is_active": true,
            "condition": {
                "condition_type": "Magento\\SalesRule\\Model\\Rule\\Condition\\Combine",
                "aggregator_type": "any",
                "operator": null,
                "value": "1"
            },
            "action_condition": {
                "condition_type": "Magento\\SalesRule\\Model\\Rule\\Condition\\Product\\Combine",
                "aggregator_type": "all",
                "operator": null,
                "value": "1"
            },
            "stop_rules_processing": false,
            "is_advanced": true,
            "sort_order": 1,
            "simple_action": "cart_fixed",
            "discount_amount": 25,
            "discount_qty": 1,
            "discount_step": 0,
            "apply_to_shipping": false,
            "times_used": 0,
            "is_rss": false,
            "coupon_type": "SPECIFIC_COUPON",
            "use_auto_generation": false,
            "uses_per_coupon": 500,
            "simple_free_shipping": "0"
    }
}

But it gives me an error which says

  SQLSTATE[23000]: Integrity constraint violation: 1048 Column
  'actions_hint_label' cannot be null.

When I add this field and gave it some value 1, 0 or something it gives me an error like

  Property "ActionsHintLabel" does not have accessor method
  "getActionsHintLabel" in class
  "Magento\SalesRule\Api\Data\RuleInterface".

Do you have any clue about that? and how to resolve that issue?
thanks for reading, thank you in advance :)


texts: How to change currency code before place order using API

texts:
I need to change the quote currency to order from the mobile app. I tried to convert quote currency from GBP to USD through the following API, but it did not work. It only adds product to the cart, and I do not know this is the right way to change the currency code. Help me solve this problem. Thanks in advance
URL : /rest/V1/carts/mine
Method : PUT
Payload :
{
"quote": {
"id": 627,
"items": [
  {
    "sku": "DISS",
    "qty": 1,
    "quote_id": "627"
  }
],
"customer": {
  "id": 9,
  "email": "sample@gmail.com",
  "firstname": "fname",
  "lastname": "lname"
},
"billing_address": {
  "region": "",
  "region_id": 0,
  "region_code": "",
  "country_id": "GB",
  "street": [
    "strrret"
  ],
  "telephone": "44",
  "postcode": "",
  "city": "city",
  "firstname": "fname",
  "lastname": "lname",
  "email": "sample@gmail.com"

},
"currency": {
  "global_currency_code": "GBP",
  "base_currency_code": "GBP",
  "store_currency_code": "GBP",
  "quote_currency_code": "USD",
  "store_to_base_rate": 1,
  "store_to_quote_rate": 1,
  "base_to_global_rate": 1,
  "base_to_quote_rate": 1.34
},
"customer_is_guest": false
 }
}


texts: Update EAV attribute value in custom admin module

texts:
I have a form container with save button . This is the method that the save button call.

public function saveAction(){
    $userId = Mage::getSingleton('admin/session')->getUser()->getId();
    $user = Mage::getModel('admin/user')->load($userId);
    $idSetting=$user->getShopsetting_entity_id();
    $setting=Mage::getSingleton('Name_Module/shopSetting')->load($idSetting);

    $setting->setData($this->getRequest()->getParam('shopSetting'));
    $setting->save();

    return $this->_redirect('*/*/index');
}

This method create another element in shopSetting_entity, but I want the attributes value is modified.

I also try using

$setting->setAttributeName($shopSetting['attribute_name']);
$setting->save();

But in this case Magento add a row in shopSetting_entity_int  with same entity_type_id,attribute_id,store_id,entity_id and does not modify the old one.

(int is the type of attribute_name)

I also try  with

$setting->setAttributeName($shopSetting['attribute_name']);
$setting->getResource()->saveAttribute($setting,'attribute_name');

But the result is always the same.

In particular case of the method saveAttribute of Mage_Eav_Model_Entity_Abstract I note that this method distinguishes between the update and insertion, this is the code:

....
 $select = $adapter->select()
                ->from($table, 'value_id')
                ->where($where);
            $origValueId = $adapter->fetchOne($select);

            if ($origValueId === false && ($newValue !== null)) {
                $this->_insertAttribute($object, $attribute, $newValue);
            } elseif ($origValueId !== false && ($newValue !== null)) {
                $this->_updateAttribute($object, $attribute, $origValueId, $newValue);
            } elseif ($origValueId !== false && ($newValue === null)) {
                $adapter->delete($table, $where);
            }
            $this->_processAttributeValues();
            $adapter->commit();
...

but _insertAttribute and _updateAttribute call the same method _saveAttribute

    protected function _insertAttribute($object, $attribute, $value)
{
    return $this->_saveAttribute($object, $attribute, $value);
}

....

    protected function _updateAttribute($object, $attribute, $valueId, $value)
{
    return $this->_saveAttribute($object, $attribute, $value);
}

maybe there's a bug