News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Create a new shipping method gives an error

Started by pimo, May 26, 2023, 16:59:50 PM

Previous topic - Next topic

pimo

I only find this file for shipping methods, could someone check if there is something different from your file?. administrator/components/com_virtuemart/tables

<?php

/**
*
* Shipment  table
*
* @package   VirtueMart
* @subpackage Shipment
* @author RickG
* @link https://virtuemart.net
* @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* @version $Id: shipmentcarriesr.php -1   $
*/
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');

/**
* Shipment  table class
* The class is is used to manage the shipment in the shop.
*
* @package   VirtueMart
* @author RickG, Max Milbers
*/
class TableShipmentmethods extends VmTable {

    /** @var int Primary key */
    var $virtuemart_shipmentmethod_id = 0;

    /** @var int Vendor ID */
    var $virtuemart_vendor_id = 0;

    /** @var int Shipment Joomla plugin I */
    var $shipment_jplugin_id = 0;

    /** @var string Shipment  name */
    var $shipment_name = '';

    /** @var string Shipment  name */
    var $shipment_desc = '';
    var $slug;
    /** @var string Element of shipmentmethod */
    var $shipment_element = '';

    var $currency_id = 0;

    /** @var string parameter of the shipmentmethod */
    var $shipment_params = 0;

    var $ordering = 0;
    var $shared = 0;

    /** @var int published boolean */
    var $published = 1;

    /**
     * @author Max Milbers
     * @param JDataBase $db
     */
    function __construct(&$db) {
      parent::__construct('#__virtuemart_shipmentmethods', 'virtuemart_shipmentmethod_id', $db);
      // we can have several time the same shipment name. It is the vendor problem to set up correctly his shipment rate.
      // $this->setUniqueName('shipment_name');
      $this->setObligatoryKeys('shipment_jplugin_id');
      $this->setObligatoryKeys('shipment_name');
      $this->setLoggable();
       $this->setLockable();
      $this->setTranslatable(array('shipment_name', 'shipment_desc'));
      $this->setSlug('shipment_name');
      $this->setTableShortCut('shipm');

      $varsToPushParam = array('display_color' => array('','char'));

      $this->setParameterable('shipment_params',$varsToPushParam);

    }


}

// pure php no closing tag

Margriet

You have a problem with your tables, not with your files. If you can, install only Joomla and VM with sample data in a subfolder with a new database and check if you have the same problem(s).

pimo

 I don't know, I'm not a programmer, but the slug is one of the problems and I see that it is different from the rest of the variables: 

var $slug;

while all other variables are different, for example the line above:

var $shipment_desc = '';

Margriet

Please read carefully: You have a problem with your tables, not with your files!!!
So check your database!

pimo

Where can I see how the database should be configured? I see my database, but I don't know if it's correct.

pimo


Margriet

QuoteYou have a problem with your tables, not with your files. If you can, install only Joomla and VM with sample data in a subfolder with a new database and check if you have the same problem(s).
As you are the only one having this problem, please debug following the advice I gave you earlier.

pimo

I don't know how to solve this problem, if you know tell me how to fix it. This problem has been made in some Virtuemart update, not created by me.

pimo

Quote from: Margriet on July 12, 2023, 09:38:12 AM
QuoteYou have a problem with your tables, not with your files. If you can, install only Joomla and VM with sample data in a subfolder with a new database and check if you have the same problem(s).
As you are the only one having this problem, please debug following the advice I gave you earlier.

I put a link of a post in which the same problem is explained and it is said that it has been fixed in the next version. So I don't think it's just my mistake.
This was working fine. Also there are more problems in the database with other features, like adding the products of an order (add a new product to the order), it also gives database problems.